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

Problem when specifying multiple invalid routes #42

Open
ameyp opened this issue Aug 2, 2013 · 1 comment
Open

Problem when specifying multiple invalid routes #42

ameyp opened this issue Aug 2, 2013 · 1 comment

Comments

@ameyp
Copy link
Contributor

ameyp commented Aug 2, 2013

This is with regards to the commit 7c4c65e.

It works well enough with one invalid route (aka a route missing a :param) but if the user specifies multiple invalid routes, the current one in the routes object is replaced by the new one. This is because utils.getRouteType returns null for both, and so they match. Hence, utils.getRoute returns the current invalid route, which is assigned to currentRoute, and hence replaced by the new invalid route.

Instead of trying to fix this, I believe it would be better to just disallow users from adding invalid routes with an assert. Thoughts?

@jsantell
Copy link
Owner

👍 I think throwing an error when using invalid routes is a simple solution for this, and can provide useful debugging information

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

No branches or pull requests

2 participants