Skip to content

Keystats will not fail graciously when there's a problem with the database #7

@ElDeveloper

Description

@ElDeveloper

If the database is corrupted, or there's a problem, Keystats will crash immediately after the program launches.

Here's the message that you get on the console:

2015-01-01 13:41:08.994 Keystats[740:21656] DB Error: 11 "database disk image is malformed"
2015-01-01 13:41:08.994 Keystats[740:21656] DB Query: SELECT COUNT(*) FROM keystrokes;
2015-01-01 13:41:08.995 Keystats[740:21656] DB Path: /Users/yoshikivazquezbaeza/Library/Application Support/Keystats/keystrokes
2015-01-01 13:41:08.995 Keystats[740:21656] *** Assertion failure in -[NSTextFieldCell _objectValue:forString:errorDescription:], /SourceCache/AppKit/AppKit-1343.16/AppKit.subproj/NSCell.m:1622
2015-01-01 13:41:08.996 Keystats[740:21656] An uncaught exception was raised
2015-01-01 13:41:08.996 Keystats[740:21656] Invalid parameter not satisfying: aString != nil
2015-01-01 13:41:08.997 Keystats[740:21656] (
    0   CoreFoundation                      0x00007fff90b4164c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff946446de objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff90b4142a +[NSException raise:format:arguments:] + 106
    3   Foundation                          0x00007fff8f8235b9 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
    4   AppKit                              0x00007fff8e18c759 -[NSCell _objectValue:forString:errorDescription:] + 160
    5   AppKit                              0x00007fff8e18c58e -[NSCell setStringValue:] + 41
    6   AppKit                              0x00007fff8e1f76a9 -[NSControl setStringValue:] + 138
    7   Keystats                            0x000000010f7293da __49-[AppDelegate computeBufferValuesAndUpdateLabels]_block_invoke + 96
    8   Keystats                            0x000000010f72cc15 __57-[YVBKeystrokesDataManager _getCountForQuery:andHandler:]_block_invoke_2 + 190
    9   Keystats                            0x000000010f73104e __30-[FMDatabaseQueue inDatabase:]_block_invoke + 55
    10  libdispatch.dylib                   0x00007fff8fa9ec13 _dispatch_client_callout + 8
    11  libdispatch.dylib                   0x00007fff8fa9fe5e _dispatch_barrier_sync_f_invoke + 57
    12  Keystats                            0x000000010f730fc3 -[FMDatabaseQueue inDatabase:] + 164
    13  Keystats                            0x000000010f72cb31 __57-[YVBKeystrokesDataManager _getCountForQuery:andHandler:]_block_invoke + 139
    14  libdispatch.dylib                   0x00007fff8faa3323 _dispatch_call_block_and_release + 12
    15  libdispatch.dylib                   0x00007fff8fa9ec13 _dispatch_client_callout + 8
    16  libdispatch.dylib                   0x00007fff8faa188f _dispatch_root_queue_drain + 935
    17  libdispatch.dylib                   0x00007fff8faaffe4 _dispatch_worker_thread3 + 91
    18  libsystem_pthread.dylib             0x00007fff8d4276cb _pthread_wqthread + 729
    19  libsystem_pthread.dylib             0x00007fff8d4254a1 start_wqthread + 13
)
2015-01-01 13:41:08.998 Keystats[740:21656] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: aString != nil'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff90b4164c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff946446de objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff90b4142a +[NSException raise:format:arguments:] + 106
    3   Foundation                          0x00007fff8f8235b9 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
    4   AppKit                              0x00007fff8e18c759 -[NSCell _objectValue:forString:errorDescription:] + 160
    5   AppKit                              0x00007fff8e18c58e -[NSCell setStringValue:] + 41
    6   AppKit                              0x00007fff8e1f76a9 -[NSControl setStringValue:] + 138
    7   Keystats                            0x000000010f7293da __49-[AppDelegate computeBufferValuesAndUpdateLabels]_block_invoke + 96
    8   Keystats                            0x000000010f72cc15 __57-[YVBKeystrokesDataManager _getCountForQuery:andHandler:]_block_invoke_2 + 190
    9   Keystats                            0x000000010f73104e __30-[FMDatabaseQueue inDatabase:]_block_invoke + 55
    10  libdispatch.dylib                   0x00007fff8fa9ec13 _dispatch_client_callout + 8
    11  libdispatch.dylib                   0x00007fff8fa9fe5e _dispatch_barrier_sync_f_invoke + 57
    12  Keystats                            0x000000010f730fc3 -[FMDatabaseQueue inDatabase:] + 164
    13  Keystats                            0x000000010f72cb31 __57-[YVBKeystrokesDataManager _getCountForQuery:andHandler:]_block_invoke + 139
    14  libdispatch.dylib                   0x00007fff8faa3323 _dispatch_call_block_and_release + 12
    15  libdispatch.dylib                   0x00007fff8fa9ec13 _dispatch_client_callout + 8
    16  libdispatch.dylib                   0x00007fff8faa188f _dispatch_root_queue_drain + 935
    17  libdispatch.dylib                   0x00007fff8faaffe4 _dispatch_worker_thread3 + 91
    18  libsystem_pthread.dylib             0x00007fff8d4276cb _pthread_wqthread + 729
    19  libsystem_pthread.dylib             0x00007fff8d4254a1 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions