[TIMOB-3043] Titanium Mobile crashes on PLSqlLiteException
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2011-10-27T18:31:05.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Douglas Soo |
Assignee | Blain Hamon |
Created | 2011-04-15T03:35:23.000+0000 |
Updated | 2017-03-09T22:48:16.000+0000 |
Description
This is essentially the same as the below misfiled issue (which appears to never have been refiled):
https://appcelerator.lighthouseapp.com/projects/25719/tickets/456-better-exception-handling-for-tidatabasedbexecute"> https://appcelerator.lighthouseapp.com/projects/25719/tickets/456-b...
Basically, SQLLite exceptions shouldn't result in the app crashing - expecially ones like this one which are ones which are likely to happen commonly due to data entry issues. It would be better to hand back some sort of result object that would tell you your success or failure status, and on failure the reason returned.
Actually, even on SQL queries that succeed you should generally return a success code - right now they return undefined on success, which is somewhat ambiguous.
Note that this is on Titanium Mobile 1.5.1, not sure if there are any changes in 1.6.0.
Thanks!
- Doug
2011-02-03 11:36:14.824 Penguine[73582:5c03] [ERROR] Error occurred calling next on a
PLSqliteResultSet. SQLite error: 'constraint failed' for 'INSERT
INTO mh_blob_metadata (id, type, update_time_ms, filename_uuid)
VALUES (?, ?, ?, ?)'
[ERROR] The application has crashed with an
unhandled exception. Stack trace: 0 CoreFoundation 0x0225bbcc
exceptionPreprocess + 156
1 libobjc.A.dylib 0x023b05c2 objc_exception_throw + 47
2 CoreFoundation 0x02214628 +[NSException raise:format:arguments:]
+ 136
3 CoreFoundation 0x0221459a +[NSException raise:format:] + 58
4 Penguine 0x00035939 -[PLSqliteResultSet next] + 294
5 Penguine 0x000c6f4d -[TiDatabaseProxy execute:] + 638
6 CoreFoundation 0x021cc67d invoking + 29
7 CoreFoundation 0x021cc551 -[NSInvocation invoke] + 145
8 Penguine 0x00044b69 -[KrollMethod call:] + 2092
9 Penguine 0x00043f1b KrollCallAsFunction + 327
10 Penguine 0x00286968
ZN2TI16TiCallbackObjectINS_8TiObjectEE4callEPNS_10TiExcStateEPS1_NS_7TiValueERKNS_7ArgListE
+ 552
11 Penguine 0x0024a838 cti_op_call_NotTiFunction + 632
12 ??? 0x0c41c402 0x0 + 205636610
13 Penguine 0x001f9fab
ZN2TI11Interpreter7executeEPNS_18FunctionExecutableEPNS_10TiExcStateEPNS_10TiFunctionEPNS_8TiObjectERKNS_7ArgListEPNS_14ScopeChainNodeEPNS_7TiValueE
+ 971
14 Penguine 0x0026620f
ZN2TI10TiFunction4callEPNS_10TiExcStateENS_7TiValueERKNS_7ArgListE
+ 127
15 Penguine 0x001a9e39
_ZN2TI4callEPNS_10TiExcStateENS_7TiValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE
+ 57
16 Penguine 0x00282ce4 TiObjectCallAsFunction + 612
17 Penguine 0x0003ebdb -[KrollCallback call:thisObject:] + 784
18 Penguine 0x0003fdf2 -[KrollEvent invoke:] + 92
19 Penguine 0x0003f483 -[KrollContext invoke:] + 43
20 Penguine 0x00040ca0 -[KrollContext main] + 3216
21 Foundation 0x005f5d4c -[NSThread main] + 81
22 Foundation 0x005f5cd8 NSThreadmain +
1387
23 libSystem.B.dylib 0x96f6785d pthread_start + 345
24 libSystem.B.dylib 0x96f676e2 thread_start + 34
2011-02-03 11:36:14.828 Penguine[73582:5c03]
Terminating app due to uncaught exception
'PLSqliteException', reason: 'Error occurred calling next on a
PLSqliteResultSet. SQLite error: 'constraint failed' for 'INSERT
INTO mh_blob_metadata (id, type, update_time_ms, filename_uuid)
VALUES (?, ?, ?, ?)''
Call stack at first throw:
( 0 CoreFoundation 0x0225bbe9 exceptionPreprocess + 185
1 libobjc.A.dylib 0x023b05c2 objc_exception_throw + 47
2 CoreFoundation 0x02214628 +[NSException raise:format:arguments:]
+ 136
3 CoreFoundation 0x0221459a +[NSException raise:format:] + 58
4 Penguine 0x00035939 -[PLSqliteResultSet next] + 294
5 Penguine 0x000c6f4d -[TiDatabaseProxy execute:] + 638
6 CoreFoundation 0x021cc67d invoking + 29
7 CoreFoundation 0x021cc551 -[NSInvocation invoke] + 145
8 Penguine 0x00044b69 -[KrollMethod call:] + 2092
9 Penguine 0x00043f1b KrollCallAsFunction + 327
10 Penguine 0x00286968
ZN2TI16TiCallbackObjectINS_8TiObjectEE4callEPNS_10TiExcStateEPS1_NS_7TiValueERKNS_7ArgListE
+ 552
11 Penguine 0x0024a838 cti_op_call_NotTiFunction + 632
12 ??? 0x0c41c402 0x0 + 205636610
13 Penguine 0x001f9fab
ZN2TI11Interpreter7executeEPNS_18FunctionExecutableEPNS_10TiExcStateEPNS_10TiFunctionEPNS_8TiObjectERKNS_7ArgListEPNS_14ScopeChainNodeEPNS_7TiValueE
+ 971
14 Penguine 0x0026620f
ZN2TI10TiFunction4callEPNS_10TiExcStateENS_7TiValueERKNS_7ArgListE
+ 127
15 Penguine 0x001a9e39
ZN2TI4callEPNS_10TiExcStateENS_7TiValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE
+ 57
16 Penguine 0x00282ce4 TiObjectCallAsFunction + 612
17 Penguine 0x0003ebdb -[KrollCallback call:thisObject:] + 784
18 Penguine 0x0003fdf2 -[KrollEvent invoke:] + 92
19 Penguine 0x0003f483 -[KrollContext invoke:] + 43
20 Penguine 0x00040ca0 -[KrollContext main] + 3216
21 Foundation 0x005f5d4c -[NSThread main] + 81
22 Foundation 0x005f5cd8 NSThreadmain +
1387
23 libSystem.B.dylib 0x96f6785d _pthread_start + 345
24 libSystem.B.dylib 0x96f676e2 thread_start + 34
) terminate called after throwing an instance of 'NSException'
[DEBUG] Session did end with error
(null)
Closing ticket as duplicate.