From 5947f767f2821fa2c54be5bd58d48270297acbbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kwa=C5=9Bniak?= Date: Tue, 24 Jan 2023 12:01:22 +0100 Subject: [PATCH] Improve task abort --- src/task.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/task.ts b/src/task.ts index 7da6af1..5e9de00 100644 --- a/src/task.ts +++ b/src/task.ts @@ -114,11 +114,10 @@ export class Task implements Promise { 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; } }