From 8608baeb7ec302daddc8adca6e39778dcf7b2eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Thu, 24 Oct 2024 20:02:05 +0200 Subject: [PATCH] fix(core): On unhandled rejections, extract the original exception correctly (#11389) --- packages/cli/src/error-reporting.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/error-reporting.ts b/packages/cli/src/error-reporting.ts index d90229130f..897bef6fef 100644 --- a/packages/cli/src/error-reporting.ts +++ b/packages/cli/src/error-reporting.ts @@ -66,9 +66,13 @@ export const initErrorHandling = async () => { }, }), ], - beforeSend(event, { originalException }) { + async beforeSend(event, { originalException }) { if (!originalException) return null; + if (originalException instanceof Promise) { + originalException = await originalException.catch((error) => error as Error); + } + if (originalException instanceof AxiosError) return null; if (