[html5] r3592 - [w] (2) Provide constants for DB errors.

whatwg at whatwg.org whatwg at whatwg.org
Tue Aug 11 18:10:57 PDT 2009


Author: ianh
Date: 2009-08-11 18:10:56 -0700 (Tue, 11 Aug 2009)
New Revision: 3592

Modified:
   source
Log:
[w] (2) Provide constants for DB errors.

Modified: source
===================================================================
--- source	2009-08-12 01:01:15 UTC (rev 3591)
+++ source	2009-08-12 01:10:56 UTC (rev 3592)
@@ -61452,7 +61452,15 @@
   arguments.</p>
 
   <pre class="idl">interface <dfn>SQLError</dfn> {
-  readonly attribute unsigned long <span title="dom-SQLError-code">code</span>;
+  const unsigned short <span title="dom-SQLException-code-UNKNOWN">UNKNOWN_ERR</span> = 0;
+  const unsigned short <span title="dom-SQLException-code-DATABASE">DATABASE_ERR</span> = 1;
+  const unsigned short <span title="dom-SQLException-code-VERSION">VERSION_ERR</span> = 2;
+  const unsigned short <span title="dom-SQLException-code-TOO_LARGE">TOO_LARGE_ERR</span> = 3;
+  const unsigned short <span title="dom-SQLException-code-QUOTA">QUOTA_ERR</span> = 4;
+  const unsigned short <span title="dom-SQLException-code-SYNTAX">SYNTAX_ERR</span> = 5;
+  const unsigned short <span title="dom-SQLException-code-CONSTRAINT">CONSTRAINT_ERR</span> = 6;
+  const unsigned short <span title="dom-SQLException-code-TIMEOUT">TIMEOUT_ERR</span> = 7;
+  readonly attribute unsigned short <span title="dom-SQLError-code">code</span>;
   readonly attribute DOMString <span title="dom-SQLError-message">message</span>;
 };</pre>
 
@@ -61471,7 +61479,15 @@
   <code>SQLException</code> exceptions:</p>
 
   <pre class="idl">exception <dfn>SQLException</dfn> {
-  unsigned long <span title="dom-SQLException-code">code</span>;
+  const unsigned short <span title="dom-SQLException-code-UNKNOWN">UNKNOWN_ERR</span> = 0;
+  const unsigned short <span title="dom-SQLException-code-DATABASE">DATABASE_ERR</span> = 1;
+  const unsigned short <span title="dom-SQLException-code-VERSION">VERSION_ERR</span> = 2;
+  const unsigned short <span title="dom-SQLException-code-TOO_LARGE">TOO_LARGE_ERR</span> = 3;
+  const unsigned short <span title="dom-SQLException-code-QUOTA">QUOTA_ERR</span> = 4;
+  const unsigned short <span title="dom-SQLException-code-SYNTAX">SYNTAX_ERR</span> = 5;
+  const unsigned short <span title="dom-SQLException-code-CONSTRAINT">CONSTRAINT_ERR</span> = 6;
+  const unsigned short <span title="dom-SQLException-code-TIMEOUT">TIMEOUT_ERR</span> = 7;
+  unsigned short <span title="dom-SQLException-code">code</span>;
   DOMString <span title="dom-SQLException-message">message</span>;
 };</pre>
 
@@ -61492,21 +61508,25 @@
   <table>
    <thead>
     <tr>
+     <th>Constant
      <th>Code
      <th>Situation
    <tbody>
 
     <tr>
+     <td><dfn title="dom-SQLException-code-UNKNOWN"><code>UNKNOWN_ERR</code></dfn>
      <td><dfn title="dom-sqlerror-code-0">0</dfn>
      <td>The transaction failed for reasons unrelated to the database
      itself and not covered by any other error code.
 
     <tr>
+     <td><dfn title="dom-SQLException-code-DATABASE"><code>DATABASE_ERR</code></dfn>
      <td><dfn title="dom-sqlerror-code-1">1</dfn>
      <td>The statement failed for database reasons not covered by any
      other error code.
 
     <tr>
+     <td><dfn title="dom-SQLException-code-VERSION"><code>VERSION_ERR</code></dfn>
      <td><dfn title="dom-sqlerror-code-2">2</dfn>
      <td>The operation failed because the actual database version was
      not what it should be. For example, a statement found that the
@@ -61521,18 +61541,21 @@
      database version.
 
     <tr>
+     <td><dfn title="dom-SQLException-code-TOO_LARGE"><code>TOO_LARGE_ERR</code></dfn>
      <td><dfn title="dom-sqlerror-code-3">3</dfn>
      <td>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.
 
     <tr>
+     <td><dfn title="dom-SQLException-code-QUOTA"><code>QUOTA_ERR</code></dfn>
      <td><dfn title="dom-sqlerror-code-4">4</dfn>
      <td>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.
 
     <tr>
+     <td><dfn title="dom-SQLException-code-SYNTAX"><code>SYNTAX_ERR</code></dfn>
      <td><dfn title="dom-sqlerror-code-5">5</dfn>
      <td>The statement failed because of a syntax error, or the number
      of arguments did not match the number of <code title="">?</code>
@@ -61543,6 +61566,7 @@
      that could modify the database but the transaction was read-only.
 
     <tr>
+     <td><dfn title="dom-SQLException-code-CONSTRAINT"><code>CONSTRAINT_ERR</code></dfn>
      <td><dfn title="dom-sqlerror-code-6">6</dfn>
      <td>An <code title="">INSERT</code>, <code
      title="">UPDATE</code>, or <code title="">REPLACE</code>
@@ -61551,6 +61575,7 @@
      primary key column duplicated the value of an existing row.
 
     <tr>
+     <td><dfn title="dom-SQLException-code-TIMEOUT"><code>TIMEOUT_ERR</code></dfn>
      <td><dfn title="dom-sqlerror-code-7">7</dfn>
      <td>A lock for the transaction could not be obtained in a
      reasonable time.




More information about the Commit-Watchers mailing list