mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Better handle undefined Error stacks in DevTools error boundary (#24065)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user