From e42779e9b86ce1d27870d00aa37491278b84f94b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 13 May 2024 09:31:37 +0200 Subject: [PATCH] Properly log the errorInfo in ErrorBoundary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/cool-garlics-clap.md | 5 +++++ .../src/layout/ErrorBoundary/ErrorBoundary.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/cool-garlics-clap.md diff --git a/.changeset/cool-garlics-clap.md b/.changeset/cool-garlics-clap.md new file mode 100644 index 0000000000..223d0a1233 --- /dev/null +++ b/.changeset/cool-garlics-clap.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Properly log the `errorInfo` in `ErrorBoundary` diff --git a/packages/core-components/src/layout/ErrorBoundary/ErrorBoundary.tsx b/packages/core-components/src/layout/ErrorBoundary/ErrorBoundary.tsx index 8f746882a1..b3a5d1db90 100644 --- a/packages/core-components/src/layout/ErrorBoundary/ErrorBoundary.tsx +++ b/packages/core-components/src/layout/ErrorBoundary/ErrorBoundary.tsx @@ -79,7 +79,7 @@ export const ErrorBoundary: ComponentClass< componentDidCatch(error: Error, errorInfo: ErrorInfo) { // eslint-disable-next-line no-console - console.error(`ErrorBoundary, error: ${error}, info: ${errorInfo}`); + console.error(`ErrorBoundary, error: ${error}`, { error, errorInfo }); this.setState({ error, errorInfo }); }