title: Properly handling duplicated key with node-mysql
body: <p>I'm writing a registration form in my application, the user's name and the user's email must be unique. 
  I run a mysql database and use node-mysql (v 2.0.0) as driver.</p>
  
  <p>When a user tries to use a name that is allready registered in the database, mysql raises the following error : <code>Error: ER_DUP_ENTRY: Duplicate entry 'John' for key 'nickname'</code>, but in the Error object raised by node-mysql contains no usefull informations about the error : </p>
  
  <pre><code>console.log(JSON.stringify(err));
  </code></pre>
  
  <blockquote>
    <p>{"code": "ER_DUP_ENTRY", "errno": 1062, "sqlState": "23000", "index": 0}</p>
  </blockquote>
  
  <p>Where can I get the involved entry and key ? I need to know which of the key <code>nickname</code> or the key <code>email</code> is responsible for the duplicate key error, so that I can warn the user.</p>
  
  <p>I know I can find this info doing <code>err.toString()</code> and parsing the result (which contains is the mysql error string itself) but I would like to know if there is a better way to do so.</p>