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

Better private Set error handling and test coverage #6359

Merged
merged 4 commits into from
Sep 10, 2022

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Sep 7, 2022

In the Routes file when using the Private set with an "unauthenticated" route that requires a parameter, the error message shown is a bit misleading. It says "We could not find a route named bazinga".

This PR reworks the error handling a little bit to show better error messages depending on what goes wrong. It also adds test for this.

@Tobbe Tobbe added the release:fix This PR is a fix label Sep 7, 2022
@Tobbe Tobbe self-assigned this Sep 7, 2022
Copy link
Contributor

@jtoar jtoar left a comment

Choose a reason for hiding this comment

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

Looks good! Just a comment that's more of a question on the bit about TS, but functionality and tests all check out.

packages/router/src/Set.tsx Outdated Show resolved Hide resolved
@jtoar jtoar merged commit e91ccd2 into redwoodjs:main Sep 10, 2022
@redwoodjs-bot redwoodjs-bot bot added this to the next-release milestone Sep 10, 2022
@Tobbe Tobbe deleted the tobbe-router-private-set-errors branch September 11, 2022 08:15
jtoar pushed a commit that referenced this pull request Sep 13, 2022
* Better private Set error handling and test coverage

* Move unauthenticated undefined check to help TS understand the code
@jtoar jtoar modified the milestones: next-release, v3.0.0 Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants