title: jQuery AJAX error callback not being called when there is an error
body: <p>I'm currently trying to implement the handling of an <em>HTTP 413: Request entity too large</em> error from my server. What I've done is this:</p>
  
  <pre><code>$.ajax({
      url: "submit.php",
      data: {
          "data": POSTData
      },
      success: function(response, statusText, XHR) {
          console.log(XHR.status + ": " + response);
          resolve(); // resolve the promise and continue on with execution
      },
      // Added this part:
      error: function(response, statusText, XHR) {
          if(XHR.status === 413) {
              // Request entity too large
              // To solve this we split the data we want to upload into several smaller partitions
              // and upload them sequentially
  
              console.log("Error 413: Request entity too large. Splitting the data into partitions...");
  
              // handling code below
  
              // blahblahblah
          }
      },
      method: "POST"
  });
  </code></pre>
  
  <p>But instead of the error callback being fired, my console still throws an error (it says it's a 413), as if there's no handler. How do I implement this functionality?</p>