mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-14 00:50:14 -04:00
Include the 'textStatus' field in DC.ajax rejection
This commit is contained in:
parent
4e1f76d3b9
commit
0612018569
1 changed files with 4 additions and 2 deletions
|
@ -54,7 +54,7 @@ Discourse.Ajax = Em.Mixin.create({
|
|||
};
|
||||
|
||||
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.
|
||||
// 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);
|
||||
}
|
||||
|
||||
// If it's a parseerror, don't reject
|
||||
// If it's a parsererror, don't reject
|
||||
if (xhr.status === 200) return args.success(xhr);
|
||||
|
||||
xhr.jqTextStatus = textStatus;
|
||||
|
||||
Ember.run(promise, promise.reject, xhr);
|
||||
if (oldError) oldError(xhr);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue