Improved error handling and error page

This commit is contained in:
Colin McLeod
2015-05-03 18:33:13 -07:00
parent 508679c185
commit 44f5409246
9 changed files with 36 additions and 24 deletions

View File

@@ -46,10 +46,10 @@ angular.module('app').config(['$provide','$stateProvider', '$urlRouterProvider',
*
*/
$provide.decorator('$exceptionHandler', ['$delegate', '$injector', function ($delegate, $injector) {
return function(exception, cause) {
return function(err, cause) {
// Go to error state, reload the controller, keep the current URL
$injector.get('$state').go('error', { details: exception }, {location:false, reload:true});
$delegate(exception, cause);
$injector.get('$state').go('error', {type:null, message: err.message, details: err.stack }, {location:false, reload:true});
$delegate(err, cause);
};
}]);