ajax: improved error messages for failed ajax calls.
This commit is contained in:
parent
fa5dd62880
commit
2f1b7cd708
2 changed files with 6 additions and 3 deletions
|
|
@ -81,7 +81,8 @@ var CodeMirrorLoadUserHints = function(query, triggerHints) {
|
|||
triggerHints(userHintsCache[query]);
|
||||
})
|
||||
.fail(function(data, textStatus, xhr) {
|
||||
alert("error processing request: " + textStatus);
|
||||
alert("error processing request. \n" +
|
||||
"Error code {0} ({1}).".format(data.status, data.statusText));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ var ajaxGET = function(url, success, failure) {
|
|||
if (failure) {
|
||||
failure(data, textStatus, xhr);
|
||||
} else {
|
||||
alert("error processing request: " + textStatus);
|
||||
alert("Error processing request. \n" +
|
||||
"Error code {0} ({1}).".format(data.status, data.statusText));
|
||||
}
|
||||
});
|
||||
return request;
|
||||
|
|
@ -63,7 +64,8 @@ var ajaxPOST = function(url, postData, success, failure) {
|
|||
if (failure) {
|
||||
failure(data, textStatus, xhr);
|
||||
} else {
|
||||
alert("error processing request: " + textStatus);
|
||||
alert("Error processing request. \n" +
|
||||
"Error code {0} ({1}).".format(data.status, data.statusText));
|
||||
}
|
||||
});
|
||||
return request;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue