From a640eaeb44e297e9667e29ea4e015e822a7c2012 Mon Sep 17 00:00:00 2001 From: Magnus Leo Date: Fri, 13 Jan 2017 11:27:54 +0100 Subject: [PATCH] Comment why the request abort error happens --- request/request.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/request/request.js b/request/request.js index 442777f9..304673fc 100644 --- a/request/request.js +++ b/request/request.js @@ -70,6 +70,8 @@ module.exports = function($window, Promise) { if (typeof args.config === "function") xhr = args.config(xhr, args) || xhr 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) { try { var response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))