(js) Improve error handling in Contacts routing
This commit is contained in:
parent
7ddf7be705
commit
e5fdc28241
|
@ -130,10 +130,14 @@
|
||||||
/**
|
/**
|
||||||
* @ngInject
|
* @ngInject
|
||||||
*/
|
*/
|
||||||
runBlock.$inject = ['$rootScope'];
|
runBlock.$inject = ['$rootScope', '$log', '$state'];
|
||||||
function runBlock($rootScope) {
|
function runBlock($rootScope, $log, $state) {
|
||||||
|
$rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error) {
|
||||||
|
$log.error(error);
|
||||||
|
$state.go('app');
|
||||||
|
});
|
||||||
$rootScope.$on('$routeChangeError', function(event, current, previous, rejection) {
|
$rootScope.$on('$routeChangeError', function(event, current, previous, rejection) {
|
||||||
console.error(event, current, previous, rejection);
|
$log.error(event, current, previous, rejection);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue