mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Include the 'textStatus' field in DC.ajax rejection
This commit is contained in:
parent
4e1f76d3b9
commit
0612018569
@ -54,7 +54,7 @@ Discourse.Ajax = Em.Mixin.create({
|
|||||||
};
|
};
|
||||||
|
|
||||||
var oldError = args.error;
|
var oldError = args.error;
|
||||||
args.error = function(xhr) {
|
args.error = function(xhr, textStatus) {
|
||||||
|
|
||||||
// note: for bad CSRF we don't loop an extra request right away.
|
// note: for bad CSRF we don't loop an extra request right away.
|
||||||
// this allows us to eliminate the possibility of having a loop.
|
// this allows us to eliminate the possibility of having a loop.
|
||||||
@ -62,9 +62,11 @@ Discourse.Ajax = Em.Mixin.create({
|
|||||||
Discourse.Session.current().set('csrfToken', null);
|
Discourse.Session.current().set('csrfToken', null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If it's a parseerror, don't reject
|
// If it's a parsererror, don't reject
|
||||||
if (xhr.status === 200) return args.success(xhr);
|
if (xhr.status === 200) return args.success(xhr);
|
||||||
|
|
||||||
|
xhr.jqTextStatus = textStatus;
|
||||||
|
|
||||||
Ember.run(promise, promise.reject, xhr);
|
Ember.run(promise, promise.reject, xhr);
|
||||||
if (oldError) oldError(xhr);
|
if (oldError) oldError(xhr);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user