Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

fix(svelte): Render correct error page#63663

Merged
fkling merged 1 commit into
mainfrom
fkling-srch-527-svelte-app-doesnt-render-correct-error-page-in-production
Jul 5, 2024
Merged

fix(svelte): Render correct error page#63663
fkling merged 1 commit into
mainfrom
fkling-srch-527-svelte-app-doesnt-render-correct-error-page-in-production

Conversation

@fkling

@fkling fkling commented Jul 5, 2024

Copy link
Copy Markdown
Contributor

Details about the probblem can be found in srch-527 (fixes srch-527).

This commit implements a workaround via the handleError hook. If this function returns an error then SvelteKit is using that instead of its own error object. So we unwrap the error object ourselves (since SvelteKit fails to do that due to bazel build issues) and ensure this way that the correct error is passed to our error template.

Test plan

Coincidentally we disabled all error related tests in CI, so by enabling these tests again we should see whether this approach works.

Details about the probblem can be found in srch-527.

This commit implements a workaround via the `handleError` hook. If this
function returns an error then SvelteKit is using that instead of its
own error object. So we unwrap the error object ourselves (since
SvelteKit fails to do that due to bazel build issues) and ensure this
way that the correct error is passed to our error template.
@fkling

fkling commented Jul 5, 2024

Copy link
Copy Markdown
Contributor Author

I added @jamesmcnamara as reviewer because he/you might be interested in why it fails with bazel.

@camdencheek camdencheek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking this down!

@fkling fkling merged commit bacf553 into main Jul 5, 2024
@fkling fkling deleted the fkling-srch-527-svelte-app-doesnt-render-correct-error-page-in-production branch July 5, 2024 19:19
@fkling

fkling commented Jul 8, 2024

Copy link
Copy Markdown
Contributor Author

FWIW it seems to work as expected in production now (not unexpected since the integration tests passed).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants