I am currently trying to implement HTTP 413 processing: request the essence of too big error from my server. I have done the following:
$.ajax({
url: "submit.php",
data: {
"data": POSTData
},
success: function(response, statusText, XHR) {
console.log(XHR.status + ": " + response);
resolve();
},
error: function(response, statusText, XHR) {
if(XHR.status === 413) {
console.log("Error 413: Request entity too large. Splitting the data into partitions...");
}
},
method: "POST"
});
But instead of triggering an error callback, my console still throws an error (it says it like 413), as if there was no handler. How to implement this functionality?
source
share