Skip to content

Commit

Permalink
Better handle undefined Error stacks in DevTools error boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Mar 9, 2022
1 parent 72a933d commit 4c68c14
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@ export default class ErrorBoundary extends Component<Props, State> {
const errorMessage =
typeof error === 'object' &&
error !== null &&
error.hasOwnProperty('message')
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')
error.hasOwnProperty('stack') &&
typeof error.stack === 'string'
? error.stack
.split('\n')
.slice(1)
Expand Down

0 comments on commit 4c68c14

Please sign in to comment.