Skip to content

Commit d925a8d

Browse files
authoredOct 24, 2022
Flight client error stack (#25560)
restore error message into stack for flight prod errors
1 parent 996b00b commit d925a8d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎packages/react-client/src/ReactFlightClient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ export function resolveErrorProd(
646646
' builds to avoid leaking sensitive details. A digest property is included on this error instance which' +
647647
' may provide additional details about the nature of the error.',
648648
);
649-
error.stack = '';
649+
error.stack = 'Error: ' + error.message;
650650
(error: any).digest = digest;
651651
const errorWithDigest: ErrorWithDigest = (error: any);
652652
const chunks = response._chunks;

‎packages/react-client/src/__tests__/ReactFlight-test.js

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ describe('ReactFlight', () => {
5757
' may provide additional details about the nature of the error.',
5858
);
5959
expect(this.state.error.digest).toContain(this.props.expectedMessage);
60+
expect(this.state.error.stack).toBe(
61+
'Error: ' + this.state.error.message,
62+
);
6063
}
6164
}
6265
render() {

0 commit comments

Comments
 (0)