mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Show a correct growl message when ajax returns a JS error rather than HTTP error.
This commit is contained in:
parent
06dd79f34c
commit
f5f655bd7a
@ -23,7 +23,11 @@ jQuery.noConflict();
|
||||
// global ajax error handlers
|
||||
$.ajaxSetup({
|
||||
error: function(xmlhttp, status, error) {
|
||||
var msg = (xmlhttp.getResponseHeader('X-Status')) ? xmlhttp.getResponseHeader('X-Status') : xmlhttp.statusText;
|
||||
if(xmlhttp.status < 200 || xmlhttp.status > 399) {
|
||||
var msg = (xmlhttp.getResponseHeader('X-Status')) ? xmlhttp.getResponseHeader('X-Status') : xmlhttp.statusText;
|
||||
} else {
|
||||
msg = error;
|
||||
}
|
||||
statusMessage(msg, 'bad');
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user