Skip to content

Commit

Permalink
error handling adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Mar 25, 2013
1 parent 088f67e commit ce724af
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ajax.js
Expand Up @@ -55,12 +55,10 @@ define(function() {
//visible via console output in the browser.
if (xhr.readyState === 4) {
status = xhr.status;
if (status > 399 && status < 600) {
if ((status > 399 && status < 600) || status == 400) {
//An http 4xx or 5xx error. Signal an error.
err = new Error(url + ' HTTP status: ' + status);
err.xhr = xhr;
if (errback)
errback(err);
errback(xhr);
}
else if (callback)
callback(xhr.responseText);
Expand Down

0 comments on commit ce724af

Please sign in to comment.