Comment why the request abort error happens
This commit is contained in:
parent
bfccd1b6bf
commit
a640eaeb44
1 changed files with 2 additions and 0 deletions
|
|
@ -70,6 +70,8 @@ module.exports = function($window, Promise) {
|
||||||
if (typeof args.config === "function") xhr = args.config(xhr, args) || xhr
|
if (typeof args.config === "function") xhr = args.config(xhr, args) || xhr
|
||||||
|
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
|
// Don't throw errors on xhr.abort(). XMLHttpRequests ends up in a state of
|
||||||
|
// xhr.status == 0 and xhr.readyState == 4 if aborted after open, but before completion.
|
||||||
if (xhr.status && xhr.readyState === 4) {
|
if (xhr.status && xhr.readyState === 4) {
|
||||||
try {
|
try {
|
||||||
var response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))
|
var response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue