title: How to show useful error messages from a database error callback in Phonegap?
body: <p>Using Phonegap you can set a function to be called back if the whole database transaction or the individual SQL statement errors. <b>I'd like to know how to get more information about the error. </b></p>
  
  <p>I have one generic error-handling function, and lots of different SELECTs or INSERTs that may trigger it. <b>How can I tell which one was at fault?</b> It is not always obvious from the error message. </p>
  
  <p>My code so far is...</p>
  
  <pre><code>function get_rows(tx) {
     tx.executeSql("SELECT * FROM Blah", [], lovely_success, statement_error);
  }
  function add_row(tx) {
     tx.executeSql("INSERT INTO Blah (1, 2, 3)", [], carry_on, statement_error);
  }
  function statement_error(tx, error) {
     alert(error.code + ' / ' + error.message);
  }
  </code></pre>
  
  <p>From various examples I see the error callback will be passed a <code>transaction</code> object and an <code>error</code> object. I read that <code>.code</code> can have the following values:</p>
  
  <ul>
  <li>UNKNOWN_ERR = 0</li>
  <li>DATABASE_ERR = 1</li>
  <li>VERSION_ERR = 2</li>
  <li>TOO_LARGE_ERR = 3</li>
  <li>QUOTA_ERR = 4</li>
  <li>SYNTAX_ERR = 5</li>
  <li>CONSTRAINT_ERR = 6</li>
  <li>TIMEOUT_ERR = 7</li>
  </ul>
  
  <p><b>Are there any other properties/methods of the error object?<br>
  What are the  properties/methods of the transaction object at this point?</b></p>
  
  <p>I can't seem to find a good online reference for this. Certainly not on the Phonegap website!</p>