diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index 19b9bd50..c2e2ccca 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -234,7 +234,10 @@ export function deepCompare(a: T, b: T): boolean { } export const createPromise = ( - timeout: number | undefined = undefined + timeout: number | undefined = undefined, + _errorHandler: (err: Error) => void = (_: Error) => { + // + } ): { promise: Promise; resolve: (value: T) => void } => { let resolver: (value: T) => void; const promise = new Promise((resolve, reject) => { @@ -246,6 +249,8 @@ export const createPromise = ( } }); + promise.catch(_errorHandler); + return { promise: promise, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion