Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include sqlite error information #122

Open
brody4hire opened this issue Aug 20, 2014 · 0 comments
Open

Include sqlite error information #122

brody4hire opened this issue Aug 20, 2014 · 0 comments

Comments

@brody4hire
Copy link

Commit e25c6fb by @lcsanchez includes some optional code (which I moved around in 08a3485) that can be used to include some more information from the sqlite library:

++(NSDictionary *)captureSQLiteErrorFromDb:(sqlite3 *)db
+{
...
+#if INCLUDE_SQLITE_ERROR_INFO
+    int extendedCode = sqlite3_extended_errcode(db);
+    const char *message = sqlite3_errmsg(db);
+
+    [error setObject:[NSNumber numberWithInt:code] forKey:@"sqliteCode"];
+    [error setObject:[NSNumber numberWithInt:extendedCode] forKey:@"sqliteExtendedCode"];
+    [error setObject:[NSString stringWithUTF8String:message] forKey:@"sqliteMessage"];
+#endif

It would be a nice feature to activate this code for iOS, and to add similar reporting for the Android & WP(8) versions.

brody4hire referenced this issue Aug 20, 2014
This updates the plugin so that it calls transaction error callbacks
with error objects that have a Web SQL 'code' property.

The plugin only maps a subset of the sqlite error codes to their Web
SQL counterparts.

Includes unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant