Delegate route/state change errors to Angular's $exceptionHandler. For ngRoute and UI-Router.
The most common source of routing errors are resolve
methods which return rejected promises. Routing libraries broadcast an event when this happens and so errors can be difficult to track down. This adds event listeners that forward routing errors to $exceptionHandler
, the service that receives thrown errors in Angular code.
$ npm install angular-router-exception-handler
angular.module('myApp', [
require('angular-router-exception-handler')
]);