From bb8b2df168aa6e1fec50238eb04da128c49d9305 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 18 Feb 2022 09:38:46 -1000 Subject: [PATCH] stringify errorInfo in ErrorBoundary so stack traces show in logs --- src/components/ErrorBoundary/BaseErrorBoundary.js | 2 +- src/components/ErrorBoundary/index.native.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ErrorBoundary/BaseErrorBoundary.js b/src/components/ErrorBoundary/BaseErrorBoundary.js index 062dcb5a2175..e479b04f7ade 100644 --- a/src/components/ErrorBoundary/BaseErrorBoundary.js +++ b/src/components/ErrorBoundary/BaseErrorBoundary.js @@ -36,7 +36,7 @@ class BaseErrorBoundary extends React.Component { } componentDidCatch(error, errorInfo) { - this.props.logError(this.props.errorMessage, error, errorInfo); + this.props.logError(this.props.errorMessage, error, JSON.stringify(errorInfo)); // We hide the splash screen since the error might happened during app init BootSplash.hide(); diff --git a/src/components/ErrorBoundary/index.native.js b/src/components/ErrorBoundary/index.native.js index ae295a9d0c4d..7792f58edbb0 100644 --- a/src/components/ErrorBoundary/index.native.js +++ b/src/components/ErrorBoundary/index.native.js @@ -9,7 +9,7 @@ BaseErrorBoundary.defaultProps.logError = (errorMessage, error, errorInfo) => { /* On native we also log the error to crashlytics * Since the error was handled we need to manually tell crashlytics about it */ - crashlytics().log(`errorInfo: ${JSON.stringify(errorInfo)}`); + crashlytics().log(`errorInfo: ${errorInfo}`); crashlytics().recordError(error); };