fix: process catch on promise timeout
This commit is contained in:
1 parent
d4ce0e6541
commit
d14126d8a6
1 file changed
+2
@@ -20,6 +20,8 @@ export const promiseTimeout = function (
|
||||
ms: number,
|
||||
promise: Promise<any>,
|
||||
): Promise<any> {
|
||||
// the promise may reject after the timeout already won the race - do not treat it as unhandled
|
||||
promise?.catch?.(() => undefined);
|
||||
let timer: NodeJS.Timeout;
|
||||
return Promise.race([
|
||||
promise,
|
||||
|
||||
Reference in new issue
Block a user