hixie: Provide constants for DB errors. (whatwg r3592)

hixie: Provide constants for DB errors. (whatwg r3592)

http://dev.w3.org/cvsweb/html5/webdatabase/Overview.html?r1=1.8&r2=1.9&f=h
http://html5.org/tools/web-apps-tracker?from=3591&to=3592

===================================================================
RCS file: /sources/public/html5/webdatabase/Overview.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Overview.html 11 Aug 2009 07:25:58 -0000 1.8
+++ Overview.html 12 Aug 2009 01:10:59 -0000 1.9
@@ -180,7 +180,7 @@
    <h1>Web Database</h1>
    <!--ZZZ:-->
    <!--<h2 class="no-num no-toc">W3C Working Draft 23 April 2009</h2>-->
-   <h2 class="no-num no-toc" id="editor-s-draft-date-1-january-1970">Editor's Draft 11 August 2009</h2>
+   <h2 class="no-num no-toc" id="editor-s-draft-date-1-january-1970">Editor's Draft 12 August 2009</h2>
    <!--:ZZZ-->
    <dl>
 <!-- ZZZ: update the month/day (twice), (un)comment out
@@ -292,7 +292,7 @@
   specification's progress along the W3C Recommendation track.
   <!--ZZZ:-->
   <!--This specification is the 23 April 2009 Working Draft.-->
-  This specification is the 11 August 2009 Editor's Draft.
+  This specification is the 12 August 2009 Editor's Draft.
   <!--:ZZZ-->
   </p>
 
@@ -1181,7 +1181,15 @@
   arguments.</p>
 
   <pre class="idl">interface <dfn id="sqlerror">SQLError</dfn> {
-  readonly attribute unsigned long <a href="#dom-sqlerror-code" title="dom-SQLError-code">code</a>;
+  const unsigned short <a href="#dom-sqlexception-code-unknown" title="dom-SQLException-code-UNKNOWN">UNKNOWN_ERR</a> = 0;
+  const unsigned short <a href="#dom-sqlexception-code-database" title="dom-SQLException-code-DATABASE">DATABASE_ERR</a> = 1;
+  const unsigned short <a href="#dom-sqlexception-code-version" title="dom-SQLException-code-VERSION">VERSION_ERR</a> = 2;
+  const unsigned short <a href="#dom-sqlexception-code-too_large" title="dom-SQLException-code-TOO_LARGE">TOO_LARGE_ERR</a> = 3;
+  const unsigned short <a href="#dom-sqlexception-code-quota" title="dom-SQLException-code-QUOTA">QUOTA_ERR</a> = 4;
+  const unsigned short <a href="#dom-sqlexception-code-syntax" title="dom-SQLException-code-SYNTAX">SYNTAX_ERR</a> = 5;
+  const unsigned short <a href="#dom-sqlexception-code-constraint" title="dom-SQLException-code-CONSTRAINT">CONSTRAINT_ERR</a> = 6;
+  const unsigned short <a href="#dom-sqlexception-code-timeout" title="dom-SQLException-code-TIMEOUT">TIMEOUT_ERR</a> = 7;
+  readonly attribute unsigned short <a href="#dom-sqlerror-code" title="dom-SQLError-code">code</a>;
   readonly attribute DOMString <a href="#dom-sqlerror-message" title="dom-SQLError-message">message</a>;
 };</pre>
 
@@ -1200,7 +1208,15 @@
   <code><a href="#sqlexception">SQLException</a></code> exceptions:</p>
 
   <pre class="idl">exception <dfn id="sqlexception">SQLException</dfn> {
-  unsigned long <a href="#dom-sqlexception-code" title="dom-SQLException-code">code</a>;
+  const unsigned short <a href="#dom-sqlexception-code-unknown" title="dom-SQLException-code-UNKNOWN">UNKNOWN_ERR</a> = 0;
+  const unsigned short <a href="#dom-sqlexception-code-database" title="dom-SQLException-code-DATABASE">DATABASE_ERR</a> = 1;
+  const unsigned short <a href="#dom-sqlexception-code-version" title="dom-SQLException-code-VERSION">VERSION_ERR</a> = 2;
+  const unsigned short <a href="#dom-sqlexception-code-too_large" title="dom-SQLException-code-TOO_LARGE">TOO_LARGE_ERR</a> = 3;
+  const unsigned short <a href="#dom-sqlexception-code-quota" title="dom-SQLException-code-QUOTA">QUOTA_ERR</a> = 4;
+  const unsigned short <a href="#dom-sqlexception-code-syntax" title="dom-SQLException-code-SYNTAX">SYNTAX_ERR</a> = 5;
+  const unsigned short <a href="#dom-sqlexception-code-constraint" title="dom-SQLException-code-CONSTRAINT">CONSTRAINT_ERR</a> = 6;
+  const unsigned short <a href="#dom-sqlexception-code-timeout" title="dom-SQLException-code-TIMEOUT">TIMEOUT_ERR</a> = 7;
+  unsigned short <a href="#dom-sqlexception-code" title="dom-SQLException-code">code</a>;
   DOMString <a href="#dom-sqlexception-message" title="dom-SQLException-message">message</a>;
 };</pre>
 
@@ -1220,21 +1236,25 @@
   <table>
    <thead>
     <tr>
+     <th>Constant
      <th>Code
      <th>Situation
    <tbody>
 
     <tr>
+     <td><dfn id="dom-sqlexception-code-unknown" title="dom-SQLException-code-UNKNOWN"><code>UNKNOWN_ERR</code></dfn>
      <td><dfn id="dom-sqlerror-code-0" 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 id="dom-sqlexception-code-database" title="dom-SQLException-code-DATABASE"><code>DATABASE_ERR</code></dfn>
      <td><dfn id="dom-sqlerror-code-1" title="dom-sqlerror-code-1">1</dfn>
      <td>The statement failed for database reasons not covered by any
      other error code.
 
     <tr>
+     <td><dfn id="dom-sqlexception-code-version" title="dom-SQLException-code-VERSION"><code>VERSION_ERR</code></dfn>
      <td><dfn id="dom-sqlerror-code-2" 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
@@ -1246,18 +1266,21 @@
      database version.
 
     <tr>
+     <td><dfn id="dom-sqlexception-code-too_large" title="dom-SQLException-code-TOO_LARGE"><code>TOO_LARGE_ERR</code></dfn>
      <td><dfn id="dom-sqlerror-code-3" 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 id="dom-sqlexception-code-quota" title="dom-SQLException-code-QUOTA"><code>QUOTA_ERR</code></dfn>
      <td><dfn id="dom-sqlerror-code-4" 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 id="dom-sqlexception-code-syntax" title="dom-SQLException-code-SYNTAX"><code>SYNTAX_ERR</code></dfn>
      <td><dfn id="dom-sqlerror-code-5" 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>
@@ -1266,6 +1289,7 @@
      that could modify the database but the transaction was read-only.
 
     <tr>
+     <td><dfn id="dom-sqlexception-code-constraint" title="dom-SQLException-code-CONSTRAINT"><code>CONSTRAINT_ERR</code></dfn>
      <td><dfn id="dom-sqlerror-code-6" title="dom-sqlerror-code-6">6</dfn>
      <td>An <code title="">INSERT</code>, <code title="">UPDATE</code>, or <code title="">REPLACE</code>
      statement failed due to a constraint failure. For example,
@@ -1273,6 +1297,7 @@
      primary key column duplicated the value of an existing row.
 
     <tr>
+     <td><dfn id="dom-sqlexception-code-timeout" title="dom-SQLException-code-TIMEOUT"><code>TIMEOUT_ERR</code></dfn>
      <td><dfn id="dom-sqlerror-code-7" title="dom-sqlerror-code-7">7</dfn>
      <td>A lock for the transaction could not be obtained in a
      reasonable time.

Received on Wednesday, 12 August 2009 01:11:57 UTC