Skip to content

Commit

Permalink
Better handle undefined Error stacks in DevTools error boundary (face…
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn authored and zhengjitf committed Apr 15, 2022
1 parent 3deabd4 commit fde00b1
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 fde00b1

Please sign in to comment.