Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: better DX for 500.astro in local development #11244

Merged
merged 16 commits into from
Jun 13, 2024
Merged

Conversation

ematipico
Copy link
Member

Changes

This PR enhance the usage of the 500.astro page when rewriting.

Before, in dev mode, we were not even displaying the custom 500.astro, probably because we wanted to show the original error. However, this was causing more issues when using the rewriting, because users needed to rewrite using the 500.astro, and see the results.

This PR catches the error in dev mode, and renders the custom 500 if present. I also logs the original error, because that won't be visible in the default 500.astro

Closes #11208

Testing

Added new test cases to test the custom 500.astro and the default 500 page (none)

Docs

N/A

Copy link

changeset-bot bot commented Jun 12, 2024

🦋 Changeset detected

Latest commit: 10c0491

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jun 12, 2024
@ematipico ematipico force-pushed the fix/rewriting-and-500 branch from eb322ce to f73f190 Compare June 12, 2024 13:43
Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

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

I think we need a changeset for this?

packages/astro/src/core/constants.ts Outdated Show resolved Hide resolved
@florian-lefebvre
Copy link
Member

Related docs PR withastro/docs#8495

Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

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

LGTM! Don't forget to update the PR I linked, specifically the part about enabling in development

@ematipico ematipico merged commit d07d2f7 into main Jun 13, 2024
14 checks passed
@ematipico ematipico deleted the fix/rewriting-and-500 branch June 13, 2024 09:41
@astrobot-houston astrobot-houston mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Experimental rewrite: Response with status:500 does not trigger 500.astro in production
2 participants