title: How can I handle warnings with the mysql node package?
body: <p>I would like to be able to handle things like "email already taken" during registration queries. The only question addressing this that I've found is here </p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/22962635/how-can-i-fetch-the-warnings-after-node-mysql-queries">How can I fetch the warnings after node-mysql queries</a></p>
  </blockquote>
  
  <p>and I haven't found it helpful.</p>
  
  <p><strong>Here's my query function</strong></p>
  
  <pre><code>newMasterAcc(input, callback){
      let newQuery = {
        sql: "INSERT INTO masteracc SET ?",
        values: [input],
        callback: (error, results, fields) =&gt; {
          if(error){
            callback(false);
          }
          else{
            callback();
          }
        }
      }
      this.pool.query(newQuery);
    }
  </code></pre>