Netflix / falcor-router

A Falcor JavaScript DataSource which creates a Virtual JSON Graph document on your app server.
http://netflix.github.io/falcor
Apache License 2.0
104 stars 46 forks source link

feat(onError): Add a onError callback on the router to catch/log exce… #185

Closed synhaptein closed 7 years ago

synhaptein commented 8 years ago

Add a onError callback on the router to catch/log exception happening in a route.

benlesh commented 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.

eddieajau commented 7 years ago

@blesh where is the best place for this change to be documented?

benlesh commented 7 years ago

@eddieajau changes are documented in the CHANGELOG.md in the root of the repository.

eddieajau commented 7 years ago

@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.