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 cb53808
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 cb53808

Please sign in to comment.