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

Make missing parameter error more descriptive #283

Merged
merged 1 commit into from
Jun 27, 2019

Conversation

mariokostelac
Copy link

While debugging some routing errors on deeply nested routes with many parameters, it became difficult to track what parameters were missing. This collects all missing parameters and adds that to the error message.

if (missingParams.length > 0) {
throw new Error(
"You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route ${name}." +
' Missing params: ${missingParams}'
Copy link
Author

Choose a reason for hiding this comment

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

unfortunately linter thinks it's a good idea to put this line with single quotes even though previous one is double quoted.

While debugging some routing errors on deeply nested routes with many parameters,
it became difficult to track what parameters were missing. This collects all missing
parameters and adds that to the error message.
@mariokostelac mariokostelac force-pushed the mario/more_descriptive_error branch from fbbdb68 to 1596570 Compare March 22, 2019 19:56
Copy link
Collaborator

@rwjblue rwjblue 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 this is great! I'm sorry I missed the original notification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants