Created
April 23, 2015 02:50
-
-
Save linus-amg/20c663ceda30e7d4d161 to your computer and use it in GitHub Desktop.
ajaxError
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ajaxError(function(evt, xhr, options) { | |
var responseText = xhr.responseText || 'The server did not respond on time.'; | |
var status = xhr.status || 408; | |
var statusText = xhr.statusText || 'Request Timeout'; | |
var message = { | |
text: responseText, | |
code: status, | |
url: xhr.url, | |
status: statusText | |
}; | |
var err = new Error(message); | |
return console.error(err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment