Fixed error in error handling

Summary:
During component cleanup broke the error handling :'). Causing plugin errors to bubble up and be handled as chrome errors instead. This caused our soft crash metric to spike in the last week.

Changelog: Fixed error handling of UI errors caused by plugins

Reviewed By: passy

Differential Revision: D29585448

fbshipit-source-id: 4c5d40b300a7b71eeb532f7be4765f742d239890
This commit is contained in:
Michel Weststrate
2021-07-07 05:09:01 -07:00
committed by Facebook GitHub Bot
parent 17e064294c
commit 88d6d000c8

View File

@@ -79,7 +79,9 @@ export default class ErrorBoundary extends Component<
<ErrorBoundaryContainer grow>
<Heading>{heading}</Heading>
{this.props.showStack !== false && (
<ErrorBoundaryStack>{error}</ErrorBoundaryStack>
<ErrorBoundaryStack>{`${
error.stack ?? error.toString()
}`}</ErrorBoundaryStack>
)}
<Button onClick={this.clearError}>Clear error and try again</Button>
</ErrorBoundaryContainer>