Skip to content

Commit

Permalink
Better handle undefined Error stacks in DevTools error boundary (#24065)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn authored Mar 10, 2022
1 parent 48a8574 commit 4a87fb5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ export default class ErrorBoundary extends Component<Props, State> {
const errorMessage =
typeof error === 'object' &&
error !== null &&
error.hasOwnProperty('message')
typeof error.message === 'string'
? error.message
: String(error);
: null;

const isTimeout = error instanceof TimeoutError;

const callStack =
typeof error === 'object' &&
error !== null &&
error.hasOwnProperty('stack')
typeof error.stack === 'string'
? error.stack
.split('\n')
.slice(1)
Expand Down

0 comments on commit 4a87fb5

Please sign in to comment.