January 2012
Intermediate to advanced
178 pages
4h 31m
English
An error in the SQL database API will be reported with a callback containing one of the codes shown in Table 5-1.
Table 5-1. Web database error codes
| Constant | Code | Situation |
|---|---|---|
| UNKNOWN_ERR | 0 | The transaction failed for reasons unrelated to the database itself and is not covered by any other error code. |
| DATABASE_ERR | 1 | The statement failed for database reasons not covered by any other error code. |
| VERSION_ERR | 2 | The operation failed because the actual database version
was not what it should be. For example, a statement found that the
actual database version no longer matches the expected version of
the Database or DatabaseSync object, or the
Database.changeVersion() or DatabaseSync.changeVersion() methods
were passed a version that doesn’t match the actual database
version. |
| TOO_LARGE_ERR | 3 | The statement failed because the data returned from the
database was too large. The SQL LIMIT modifier might
be useful to reduce the size of the result set. |
| QUOTA_ERR | 4 | The statement failed because there was not enough remaining storage space, or the storage quota was reached and the user declined to give more space to the database. |
| SYNTAX_ERR | 5 | The statement failed because of a syntax error, the number
of arguments did not match the number of ? placeholders in the
statement, the statement tried to use a statement that is not
allowed, such as BEGIN,
COMMIT, or ROLLBACK, or the statement tried to use
a verb that could modify the database when the transaction was
read-only. |
| CONSTRAINT_ERR | 6 | An ... |
Read now
Unlock full access