Better handle undefined Error stacks in DevTools error boundary (#24065)

This commit is contained in:
Brian Vaughn
2022-03-10 10:36:47 -08:00
committed by GitHub
parent 48a8574a68
commit 4a87fb5211

View File

@@ -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)