Skip to content

Commit

Permalink
Improve task abort
Browse files Browse the repository at this point in the history
  • Loading branch information
Exelord committed Jan 24, 2023
1 parent ad44d2e commit 5947f76
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@ export class Task<T> implements Promise<T> {
this.#handleFailure(error);
this.#abortController.abort(error);

// We don't want to throw any error as cancellation has been successful.
// We just want to make sure that the promise has been rejected if pending.
// We want to make sure that the promise has been rejected if pending.
try {
await this.#promise;
} catch (error) {
} catch {
return;
}
}
Expand Down

0 comments on commit 5947f76

Please sign in to comment.