Closed synhaptein closed 7 years ago
@synhaptein, there's now an option called hooks
that provides this functionality.
new Router(routes, {
hooks: {
error: function (path, error) {
var router = this;
// do what you're going to do here.
}
});
Thank you so much for your contribution! Apologies for the delayed response.
@blesh where is the best place for this change to be documented?
@eddieajau changes are documented in the CHANGELOG.md in the root of the repository.
@blesh sorry, what I really meant to ask is where would this addition be documented for developers with examples of how to use it? I'm happy to take a stab if you can tell me where it should live.
Add a onError callback on the router to catch/log exception happening in a route.