From f2c0cf61d58568b8279c5f1d4588fa90c923e448 Mon Sep 17 00:00:00 2001 From: Amir Ghezelbash Date: Tue, 26 Nov 2024 19:16:09 +0330 Subject: [PATCH] chore: Improve Error Logging in ErrorFallback (#18386) * chore: Add a stacktrace to error boundary * chore: Improve Error Logging in ErrorFallback --- src/script/components/ErrorFallback/ErrorFallback.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/script/components/ErrorFallback/ErrorFallback.tsx b/src/script/components/ErrorFallback/ErrorFallback.tsx index 4685f559b06..0e94101ff78 100644 --- a/src/script/components/ErrorFallback/ErrorFallback.tsx +++ b/src/script/components/ErrorFallback/ErrorFallback.tsx @@ -29,7 +29,9 @@ const logger = getLogger('ErrorFallback'); export const ErrorFallback = ({error, resetErrorBoundary}: FallbackProps) => { useEffect(() => { - logger.error(error); + const customError = new Error(); + logger.error({originalError: error, originalStack: error?.stack, fallbackInvocationStack: customError.stack}); + PrimaryModal.show(PrimaryModal.type.CONFIRM, { preventClose: true, secondaryAction: {