Flight client error stack (#25560)
restore error message into stack for flight prod errors
This commit is contained in:
parent
996b00b787
commit
d925a8d0be
|
@ -646,7 +646,7 @@ export function resolveErrorProd(
|
|||
' builds to avoid leaking sensitive details. A digest property is included on this error instance which' +
|
||||
' may provide additional details about the nature of the error.',
|
||||
);
|
||||
error.stack = '';
|
||||
error.stack = 'Error: ' + error.message;
|
||||
(error: any).digest = digest;
|
||||
const errorWithDigest: ErrorWithDigest = (error: any);
|
||||
const chunks = response._chunks;
|
||||
|
|
|
@ -57,6 +57,9 @@ describe('ReactFlight', () => {
|
|||
' may provide additional details about the nature of the error.',
|
||||
);
|
||||
expect(this.state.error.digest).toContain(this.props.expectedMessage);
|
||||
expect(this.state.error.stack).toBe(
|
||||
'Error: ' + this.state.error.message,
|
||||
);
|
||||
}
|
||||
}
|
||||
render() {
|
||||
|
|
Loading…
Reference in New Issue