title: Adding a condition for success or error using jQuery ajax + Wordpress
body: <p>When using the Wordpress "nonce" system to authenticate an AJAX request, a response of "-1" is returned if the authentication fails.  Rather than doing something like this in every jQuery.ajax success function:</p>
  
  <pre><code>success: function(msg){
      if (msg == '-1')
          console.debug('error')
      else {
          // ...
      }
  }
  </code></pre>
  
  <p>is it possible to somehow augment jQuery and add a condition for my application that error: rather than success: is fired when the message returned is "-1"?  Obviously much cleaner than a bunch of the same if statements.</p>
  
  <p>I realize the normal response is to have the controller return a 4xx header, but would rather not have the Wordpress plugin change the default behaviour of the ajax handler and possibly mess up other Wordpress plugins.</p>
  
  <p>Thanks!</p>