34
rated 0 times
[
36]
[
2]
/ answers: 1 / hits: 26390
/ 12 Years ago, sat, may 5, 2012, 12:00:00
I am trying to use the try-catch
statements to handle the errors from XMLHTTPRequest
, like below:
var xhr = new XMLHttpRequest();
xhr.open('POST', someurl, true);
try{
xhr.sendMultipart(object);
}
catch(err){
error_handle_function();
}
When there was a 401 error thrown by xhr.sendMultipart
, the error_handle_function
was not called. Any idea how to fix this?
Thanks!
More From » xmlhttprequest