Properly log the errorInfo in ErrorBoundary

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2024-05-13 09:31:37 +02:00
parent 2f6e3e6b47
commit e42779e9b8
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Properly log the `errorInfo` in `ErrorBoundary`
@@ -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 });
}