Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Pass caught server error to custom error component.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebecca Gowland committed Nov 5, 2020
1 parent 29e5390 commit 095d2a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

- Added `renderRawErrorMessage` to the options for `createRender` and `createServer`, controls rendering of raw stack or custom error page for SSR errors. Defaults to old behaviour, which is raw stack for development only.

- Assign `ctx.state.quiltError` to exception caught after server error. ([#1667](https://github.com/Shopify/quilt/pull/1667))

<!-- ## [Unreleased] -->

## [0.19.0] - 2020-10-26

- Added `htmlProps` to the options for `createRender` and `createServer`, these props will be passed into the call to `@shopify/react-html`'s `<Html>` component ([#1661](https://github.com/Shopify/quilt/pull/1661))
Expand Down
1 change: 1 addition & 0 deletions packages/react-server/src/render/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export function createRender(

logger.log(errorMessage);
ctx.status = StatusCode.InternalServerError;
ctx.state.quiltError = error;

if (renderRawErrorMessage) {
ctx.body = errorMessage;
Expand Down

0 comments on commit 095d2a0

Please sign in to comment.