From 832a59031aba65e124d2fed5f027177ba7f1345d Mon Sep 17 00:00:00 2001 From: thislight Date: Mon, 4 Nov 2024 17:08:30 +0800 Subject: [PATCH] UnexpectedError: add error repl if failed to parse --- src/UnexpectedError.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/UnexpectedError.tsx b/src/UnexpectedError.tsx index aa7f468..906d99d 100644 --- a/src/UnexpectedError.tsx +++ b/src/UnexpectedError.tsx @@ -18,7 +18,16 @@ const UnexpectedError: Component<{ error?: any }> = (props) => { .join("\n"); return `${err.name}: ${err.message}\n${strackMsg}`; } catch (reason) { - return `\n${reason}`; + return `\n${reason}\n${JSON.stringify( + { + name: err.name, + stack: err.stack, + cause: err.cause, + message: err.message, + }, + undefined, + 2, + )}`; } }