Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1030574 of IDBDatabaseException

  • Revision slug: Web/API/IDBDatabaseException
  • Revision title: IDBDatabaseException
  • Revision id: 1030574
  • Created:
  • Creator: jpmedley
  • Is current revision? Yes
  • Comment

Revision Content

{{APIRef("IndexedDB")}}

Obsolete: This interface was removed from the specification and was replaced by usage of {{ domxref("DOMException") }}.

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

Attributes

Attribute Type Description
code unsigned short The most appropriate error code for the condition.
message DOMString Error 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. ") }}

Constant Value Description
ABORT_ERR 8 A request was aborted, for example, through a call to IDBTransaction.abort.
CONSTRAINT_ERR 4 A 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_ERR 5 Data provided to an operation does not meet requirements.
NON_TRANSIENT_ERR 2 An 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_ERR 6

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_ERR 3 The operation failed because the requested database object could not be found; for example, an object store did not exist but was being opened.
QUOTA_ERR 11 Either 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_ERR 9 A mutation operation was attempted in a READ_ONLY transaction.
TIMEOUT_ERR 10 A lock for the transaction could not be obtained in a reasonable time.
TRANSACTION_INACTIVE_ERR 7 A request was made against a transaction that is either not currently active or is already finished.
UNKNOWN_ERR 1 The 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_ERR 12 A request to open a database with a version lower than the one it already has. This can only happen with IDBOpenDBRequest.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 12 {{ property_prefix("-webkit") }} {{ CompatGeckoDesktop("2.0") }} {{ Obsolete_inline("Gecko 14") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
VER_ERR {{ CompatNo }} {{ CompatGeckoDesktop("10.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatNo() }} {{ CompatGeckoMobile("2.0") }} {{ Obsolete_inline("Gecko 14") }} {{ CompatUnknown() }} {{ CompatNo() }} {{ CompatNo() }}
VER_ERR {{ CompatNo() }} {{ CompatGeckoMobile("10.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

 

Revision Source

<div>{{APIRef("IndexedDB")}}</div>

<div class="warning style-wrap">
<p><strong>Obsolete:</strong> This interface was removed from the specification and was replaced by usage of {{ domxref("DOMException") }}.</p>
</div>

<p>In the <a href="/en/IndexedDB" title="en/IndexedDB">IndexedDB API</a>, an <code>IDBDatabaseException</code> object represents exception conditions that can be encountered while performing database operations.</p>

<h2 id="Attributes">Attributes</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Attribute</th>
   <th scope="col">Type</th>
   <th scope="col">Description</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><a name="attr_code"><code>code</code></a></td>
   <td><code>unsigned short</code></td>
   <td>The most appropriate error code for the condition.</td>
  </tr>
  <tr>
   <td><a name="attr_message"><code>message</code></a></td>
   <td><code>DOMString</code></td>
   <td>Error message describing the exception raised.</td>
  </tr>
 </tbody>
</table>

<h2 id="Constants">Constants</h2>

<p>{{ 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.&nbsp;") }}</p>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Constant</th>
   <th scope="col">Value</th>
   <th scope="col">Description</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><code><a name="ABORT_ERR">ABORT_ERR</a></code></td>
   <td><code>8</code></td>
   <td>A request was aborted, for example, through a call to<a href="/en/IndexedDB/IDBTransaction#abort" title="en/IndexedDB/IDBTransaction#abort"> <code>IDBTransaction.abort</code></a>.</td>
  </tr>
  <tr>
   <td><code><a name="CONSTRAINT_ERR">CONSTRAINT_ERR</a></code></td>
   <td><code>4</code></td>
   <td>A 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.</td>
  </tr>
  <tr>
   <td><code><a name="DATA_ERR">DATA_ERR</a></code></td>
   <td><code>5</code></td>
   <td>Data provided to an operation does not meet requirements.</td>
  </tr>
  <tr>
   <td><code><a name="NON_TRANSIENT_ERR">NON_TRANSIENT_ERR</a></code></td>
   <td><code>2</code></td>
   <td>An operation was not allowed on an object. Unless the cause of the error is corrected, retrying the same operation would result in failure.</td>
  </tr>
  <tr>
   <td><code><a name="NOT_ALLOWED_ERR">NOT_ALLOWED_ERR</a></code></td>
   <td><code>6</code></td>
   <td>
    <p>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.</p>

    <p>More specific variants of this error includes: <code> TRANSACTION_INACTIVE_ERR</code> and <code>READ_ONLY_ERR</code>.</p>
   </td>
  </tr>
  <tr>
   <td><code><a name="NOT_FOUND_ERR">NOT_FOUND_ERR</a></code></td>
   <td><code>3</code></td>
   <td>The operation failed because the requested database object could not be found; for example, an object store did not exist but was being opened.</td>
  </tr>
  <tr>
   <td><code><a name="QUOTA_ERR">QUOTA_ERR</a></code></td>
   <td><code>11</code></td>
   <td>Either there's not enough remaining storage space or the storage quota was reached and the user declined to give more space to the database.</td>
  </tr>
  <tr>
   <td><code><a name="READ_ONLY_ERR">READ_ONLY_ERR</a></code></td>
   <td><code>9</code></td>
   <td>A mutation operation was attempted in a <code>READ_ONLY</code>&nbsp;transaction.</td>
  </tr>
  <tr>
   <td><code><a name="TIMEOUT_ERR">TIMEOUT_ERR</a></code></td>
   <td><code>10</code></td>
   <td>A lock for the transaction could not be obtained in a reasonable time.</td>
  </tr>
  <tr>
   <td><a name="TRANSACTION_INACTIVE_ERR"><code>TRANSACTION_INACTIVE_ERR</code></a></td>
   <td><code>7</code></td>
   <td>A request was made against a transaction that is either not currently active or is already finished.</td>
  </tr>
  <tr>
   <td><code><a name="UNKNOWN_ERR">UNKNOWN_ERR</a></code></td>
   <td><code>1</code></td>
   <td>The 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.</td>
  </tr>
  <tr>
   <td><code><a name="VER_ERR">VER_ERR</a></code></td>
   <td><code>12</code></td>
   <td>A request to open a database with a version lower than the one it already has. This can only happen with <a href="/en/IndexedDB/IDBOpenDBRequest" title="en/IndexedDB/IDBOpenDBRequest"><code>IDBOpenDBRequest</code></a>.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_Compatibility" name="Browser_Compatibility">Browser compatibility</h2>

<p>{{ CompatibilityTable() }}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>12 {{ property_prefix("-webkit") }}</td>
   <td>{{ CompatGeckoDesktop("2.0") }} {{ Obsolete_inline("Gecko 14") }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
  </tr>
  <tr>
   <td><code>VER_ERR</code></td>
   <td>{{ CompatNo }}</td>
   <td>{{ CompatGeckoDesktop("10.0") }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE&nbsp;Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatGeckoMobile("2.0") }} {{ Obsolete_inline("Gecko 14") }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
  </tr>
  <tr>
   <td><code>VER_ERR</code></td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatGeckoMobile("10.0") }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
  </tr>
 </tbody>
</table>
</div>

<p>&nbsp;</p>
Revert to this revision