-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix(routing): improve error handling #14161
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 9bdc5ad 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 |
CodSpeed Performance ReportMerging #14161 will not alter performanceComparing Summary
Footnotes |
df7778d
to
942a721
Compare
942a721
to
37e57c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the behaviour now, if one of these invalid redirects was created?
As mentioned in the bug report, the error is generic:
|
Co-authored-by: Matt Kane <[email protected]>
This still doesn't test for the example in the issue, and I'm not sure it would catch it. The original had the same number of dynamic segments on each side: redirects: {
'/categories/[category]': '/category/[category]/1',
} |
Sorry, I missed that. I'll add a test for that too |
@ematipico what are your plans for this PR? |
Changes
Closes #12036
Astro didn't perform any validation of the route mappings. This PR introduces a new function that performs this task.
An error is thrown when a redirect can't be mapped to a new route.
Testing
Added a new test
Docs