From 110d982c0cb00c9ce38978e06ad597911599a0f4 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Mon, 3 Jul 2023 10:20:06 -0600 Subject: [PATCH] Minor tweak to comment about `.catch` handler Co-authored-by: Lenz Weber-Tronic --- src/utilities/promises/decoration.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/utilities/promises/decoration.ts b/src/utilities/promises/decoration.ts index a8d5210b3f9..2b32e2e6623 100644 --- a/src/utilities/promises/decoration.ts +++ b/src/utilities/promises/decoration.ts @@ -29,9 +29,7 @@ export function createFulfilledPromise(value: TValue) { export function createRejectedPromise(reason: unknown) { const promise = Promise.reject(reason) as RejectedPromise; - // prevent unhandled error rejections since this is usually used with __use - // which synchronously reads the `status` and `reason` properties to throw - // the error. + // prevent potential edge cases leaking unhandled error rejections promise.catch(() => {}); promise.status = 'rejected';