[TIMOB-2619] Ti.Database does not expose SQLite exceptions
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-26T12:45:03.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.7.0, Sprint 2011-12 |
Components | Android |
Labels | android, database, defect, release-1.5.1, release-1.7.0 |
Reporter | Paul Dowsett |
Assignee | Don Thorp |
Created | 2011-04-15T03:25:00.000+0000 |
Updated | 2011-05-23T10:21:25.000+0000 |
Description
No sqlite exceptions are exposed to the Ti user. For android, exceptions can be viewed using adb.
The following situations were discussed with Don:
- Duplicate key inserted. Using the sqlite console directly
returns
Error executing sql: error code 19: constraint failed
. However, Titanium will continue with the following row inserts and they will be inserted successfully. - Value missing for NOTNULL field. Using the sqlite console
directly for
"insert into
condition" values('some',,'my url');returns
Error: near ",": syntax error. However, Titanium will insert the data with 'undefined' in the NOTNULL columns
Possibly there are pros and cons to Titanium's behaviour, so it probably needs further consideration and more examples.
Also an issue with iOS, for the record.
I think this is a very important ticket since an error in the statement or a constraint failure crashes the whole app without any possibility to circumvent this. The Priority should be higher than "Low" and I would like to have a solution for this as soon as possible.
By the way, it's a duplicate of #1666
@Martin we use 1 ticket per platform so it's not technically a duplicate.
(from [d608fe27b052f7e13bd47b35a27b7e3dbf6d6711]) [#2619 state:fixed-in-qa] exception chucking enabled https://github.com/appcelerator/titanium_mobile/commit/d608fe27b052f7e13bd47b35a27b7e3dbf6d6711"> https://github.com/appcelerator/titanium_mobile/commit/d608fe27b052...