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

1.0: defaultErrorHandler not called when a transition is Cancelled #2924

Closed
christopherthielen opened this issue Aug 16, 2016 · 4 comments
Closed

Comments

@christopherthielen
Copy link
Contributor

If you return false from a hook, the defaultErrorHandler should be invoked.

@jonrimmer
Copy link

I just ran into this while upgrading to 1.0, and it seems like really bad API design.

If I have written some code to intentionally cancel a transition, it's not an error. It's not exceptional behaviour. It's literally my application behaving as intended.

I know I can override the defaultErrorHandler to circumvent this behaviour, but this feels like a pretty ugly workaround. What if defaultErrorHandler is later enhanced with functionality I need in my app? Am I going to have to keep tracking the upstream implementation and merging the changes back into my copy?

Wouldn't it be better to at least have some way of silently cancelling a transition? Maybe by returning some token like Transition.CANCELLED?

@christopherthielen
Copy link
Contributor Author

@jonrimmer After reading your comments, I'm reconsidering this change

@jonrimmer
Copy link

@christopherthielen Hey, reading this back and worried I came across a bit rude. I want to say that your work on 1.0 is totally awesome! I got the whole of our codebase upgraded from 0.2 in just a couple of hours. All the new stuff and documentation is fantastic :-) 👍

@christopherthielen
Copy link
Contributor Author

New issue in core ui-router/core#35 to revert this change

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

No branches or pull requests

2 participants