Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 8827e1e

Browse files
committed
fix(xhr): don't throw on an xhr which is aborted before sending
1 parent 0ce5fa2 commit 8827e1e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: lib/browser/browser.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ function patchXHR(window: any) {
9696
var task: Task = findPendingTask(self);
9797
if (task && typeof task.type == 'string') {
9898
task.zone.cancelTask(task);
99-
} else {
100-
throw new Error('tried to abort an XHR which has not yet been sent');
10199
}
100+
// Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no task to cancel. Do nothing.
102101
});
103102
}
104103

0 commit comments

Comments
 (0)