Skip to content

Commit

Permalink
Add code constants on SQLErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
thgreasi committed Dec 8, 2019
1 parent 3952ac5 commit bdeb6ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions SQLitePlugin.coffee.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@
sqlError = new Error "an unknown error was returned: " + JSON.stringify(sqlError)
sqlError.code = code

sqlError.UNKNOWN_ERR = 0
sqlError.DATABASE_ERR = 1
sqlError.VERSION_ERR = 2
sqlError.TOO_LARGE_ERR = 3
sqlError.QUOTA_ERR = 4
sqlError.SYNTAX_ERR = 5
sqlError.CONSTRAINT_ERR = 6
sqlError.TIMEOUT_ERR = 7

return sqlError

nextTick = window.setImmediate || (fun) ->
Expand Down
8 changes: 8 additions & 0 deletions www/SQLitePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
sqlError = new Error("an unknown error was returned: " + JSON.stringify(sqlError));
sqlError.code = code;
}
sqlError.UNKNOWN_ERR = 0;
sqlError.DATABASE_ERR = 1;
sqlError.VERSION_ERR = 2;
sqlError.TOO_LARGE_ERR = 3;
sqlError.QUOTA_ERR = 4;
sqlError.SYNTAX_ERR = 5;
sqlError.CONSTRAINT_ERR = 6;
sqlError.TIMEOUT_ERR = 7;
return sqlError;
};

Expand Down

0 comments on commit bdeb6ba

Please sign in to comment.