refactor: XHR errors have response/code fields
So that there's no chance of data loss and it's trivial to get the response code (because it's hella useful) Fixes #1866 Fixes #1876
This commit is contained in:
parent
1a1ae8e843
commit
5aac004709
2 changed files with 6 additions and 4 deletions
|
|
@ -93,7 +93,8 @@ module.exports = function($window, Promise) {
|
|||
}
|
||||
else {
|
||||
var error = new Error(xhr.responseText)
|
||||
for (var key in response) error[key] = response[key]
|
||||
error.code = xhr.status
|
||||
error.response = response
|
||||
reject(error)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue