Skip to content

Commit

Permalink
Minor tweak to comment about .catch handler
Browse files Browse the repository at this point in the history
Co-authored-by: Lenz Weber-Tronic <[email protected]>
  • Loading branch information
jerelmiller and phryneas authored Jul 3, 2023
1 parent 22b695c commit 110d982
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/utilities/promises/decoration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export function createFulfilledPromise<TValue>(value: TValue) {
export function createRejectedPromise<TValue = unknown>(reason: unknown) {
const promise = Promise.reject(reason) as RejectedPromise<TValue>;

// 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';
Expand Down

0 comments on commit 110d982

Please sign in to comment.