title: How to catch error in ajax callback between success and error?
body: <p>I have a method call Ajax: </p>
  
  <pre><code>function callAjax(url, type, json, callback) {
    $.ajax({
      type: type,
      url: url,
      data: json,
      async: false,
      success: function (data) {
          if (callback) {
              callback(data);
          }
      }
  });
  }
  </code></pre>
  
  <p>But I don't call back with error in callback.<br>
  For example, I can callAjax method like this:</p>
  
  <pre><code> callAjax("http://stackoverflow.com/", "POST", data, function(resp,status){
    if(status.success){
        //code here
      }
       if(status.error){
     //code here
     }
   });
  </code></pre>