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

Commit

Permalink
fix(xhr): don't throw on an xhr which is aborted before sending
Browse files Browse the repository at this point in the history
  • Loading branch information
juliemr committed Apr 4, 2016
1 parent 0ce5fa2 commit 8827e1e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/browser/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ function patchXHR(window: any) {
var task: Task = findPendingTask(self);
if (task && typeof task.type == 'string') {
task.zone.cancelTask(task);
} else {
throw new Error('tried to abort an XHR which has not yet been sent');
}
// Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no task to cancel. Do nothing.
});
}

Expand Down

0 comments on commit 8827e1e

Please sign in to comment.