error
Summary
The error codes returned under certain conditions.
Property of apis/indexeddb/IDBRequestapis/indexeddb/IDBRequest
Syntax
Note: This property is read-only.
var result = element.error;
Return Value
Returns an object of type DOMErrorDOMError
Usage
The following error codes are returned under certain conditions:
- AbortError — If you abort the transaction, then all requests still in progress receive this error.
- ConstraintError — If you insert data that doesn’t conform to a constraint. It’s an exception type for creating stores and indexes. You get this error, for example, if you try to add a new key that already exists in the record.
- QuotaExceededError — If you run out of disk quota and the user declined to grant you more space.
- UnknownError — If the operation failed for reasons unrelated to the database itself. A failure due to disk IO errors is such an example.
- NoError — If the request succeeds.
- VersionError — If you try to open a database with a version lower than the one it already has.
In addition to the error codes sent to the IDBRequest object, asynchronous operations can also raise exceptions. The list describes problems that could occur when the request is being executed, but you might also encounter other problems when the request is being made. For example, if the the request failed and the result is not available, the InvalidStateError exception is thrown.
Notes
Remarks
The cause of the error depends on the operation that triggered the error; use the name to determine the underlying problem.
Syntax
Standards information
Attributions
Mozilla Developer Network : Article
Microsoft Developer Network: [Windows Internet Explorer API reference Article]