fix: process catch on promise timeout

This commit is contained in:
devlikepro committed 2026-08-05 14:34:59 +07:00
1 parent d4ce0e6541
commit d14126d8a6
1 file changed
+2
+2
View File
@@ -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,