IDBDatabaseException - Web APIs 编辑

Obsolete: This interface was removed from the specification and was replaced by usage of DOMException.

In the IndexedDB API, an IDBDatabaseException object represents exception conditions that can be encountered while performing database operations.

Attributes

AttributeTypeDescription
codeunsigned shortThe most appropriate error code for the condition.
messageDOMStringError message describing the exception raised.

Constants

Note:

Do not rely on the numeric values of the constants, which might change as the specifications continue to change. Use the constant names instead. 
ConstantValueDescription
ABORT_ERR8A request was aborted, for example, through a call to IDBTransaction.abort.
CONSTRAINT_ERR4A mutation operation in the transaction failed because a constraint was not satisfied. For example, an object, such as an object store or index, already exists and a request attempted to create a new one.
DATA_ERR5Data provided to an operation does not meet requirements.
NON_TRANSIENT_ERR2An operation was not allowed on an object. Unless the cause of the error is corrected, retrying the same operation would result in failure.
NOT_ALLOWED_ERR6

An operation was called on an object where it is not allowed or at a time when it is not allowed. It also occurs if a request is made on a source object that has been deleted or removed.

More specific variants of this error includes: TRANSACTION_INACTIVE_ERR and READ_ONLY_ERR.

NOT_FOUND_ERR3The operation failed because the requested database object could not be found; for example, an object store did not exist but was being opened.
QUOTA_ERR11Either there's not enough remaining storage space or the storage quota was reached and the user declined to give more space to the database.
READ_ONLY_ERR9A mutation operation was attempted in a READ_ONLY transaction.
TIMEOUT_ERR10A lock for the transaction could not be obtained in a reasonable time.
TRANSACTION_INACTIVE_ERR7A request was made against a transaction that is either not currently active or is already finished.
UNKNOWN_ERR1The operation failed for reasons unrelated to the database itself, and it is not covered by any other error code--for example, a failure due to disk IO errors.
VER_ERR12A request to open a database with a version lower than the one it already has. This can only happen with IDBOpenDBRequest.

Browser compatibility

BCD tables only load in the browser

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:80 次

字数:4858

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文