Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #268 from sminnee/raise-js-errors

BUGFIX: Show a correct growl message when ajax returns a JS error rather than HTTP error.
  • Loading branch information...
commit 06a4e1aad6ba2cc5e616d56386db7e1f0ee46084 2 parents 2a853b1 + f5f655b
@chillu chillu authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 admin/javascript/LeftAndMain.js
View
6 admin/javascript/LeftAndMain.js
@@ -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');
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.