Skip to content

Commit

Permalink
Flight client error stack (#25560)
Browse files Browse the repository at this point in the history
restore error message into stack for flight prod errors
  • Loading branch information
gnoff authored and rickhanlonii committed Dec 3, 2022
1 parent 7dd9be0 commit 544412b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-client/src/ReactFlightClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions packages/react-client/src/__tests__/ReactFlight-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 544412b

Please sign in to comment.