Revision 6a3a5bf7 ui/static/snf/js/sync.js
b/ui/static/snf/js/sync.js | ||
---|---|---|
110 | 110 |
if (type == "error") { |
111 | 111 |
add_api_error(this, arguments); |
112 | 112 |
} |
113 |
|
|
114 |
var status = 304; |
|
115 |
if (arguments[0]) { |
|
116 |
var status = arguments[0].status; |
|
117 |
} |
|
113 | 118 |
|
114 |
if (type == "error" && this.handles_error) { return method.apply(this, arguments)} |
|
119 |
if (type == "error" && this.handles_error && ((status > 499 && status < 600) || status == 400)) { |
|
120 |
arguments.ajax = this; |
|
121 |
return method(arguments) |
|
122 |
} |
|
115 | 123 |
|
116 | 124 |
var args = wrap.apply(this, arguments); |
117 | 125 |
args = _.toArray(args); |
... | ... | |
163 | 171 |
|
164 | 172 |
// skip aborts |
165 | 173 |
if (xhr != "abort") { |
174 |
arguments.ajax.critical = arguments.ajax.critical == undefined ? true : arguments.ajax.critical; |
|
166 | 175 |
if (!settings.handles_error) api.trigger("error", arguments); |
167 | 176 |
} |
168 | 177 |
return arguments; |
Also available in: Unified diff