Flight client error stack (#25560)

restore error message into stack for flight prod errors
This commit is contained in:
Josh Story 2022-10-24 16:32:33 -07:00 committed by GitHub
parent 996b00b787
commit d925a8d0be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

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

View File

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