diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-13 14:39:47 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-13 14:39:47 -0400 |
| commit | e64295d1c8a96c247380963c9746b9c7be2cf1a8 (patch) | |
| tree | 0a6912c7771a23cb360031fad316808b156df4a6 /www/js/app.js | |
| parent | c77cbcca1d92de987a0e97a7c05e23d03f6c6368 (diff) | |
various fixes
Diffstat (limited to 'www/js/app.js')
| -rw-r--r-- | www/js/app.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/www/js/app.js b/www/js/app.js index ddf23ffb..8ebe7801 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -484,6 +484,11 @@ angular.module('zmApp', [ var loginData = ZMDataModel.getLogin(); + //$rootScope.exceptionMessage({reason:exception, cause:cause}); + $rootScope.exceptionMessage = function(error) + { + ZMDataModel.zmDebug("**EXCEPTION**"+error.reason+" caused by " + error.cause); + }; // This code takes care of trapping the Android back button // and takes it to the menu. @@ -706,7 +711,21 @@ angular.module('zmApp', [ //------------------------------------------------------------------ // My route map connecting menu options to their respective templates and controllers -.config(function ($stateProvider, $urlRouterProvider, $httpProvider, $ionicConfigProvider) { +.config(function ($stateProvider, $urlRouterProvider, $httpProvider, $ionicConfigProvider, $provide) { + + + $provide.decorator("$exceptionHandler", ['$delegate','$injector', function($delegate, $injector) { + return function(exception, cause) { + + + var $rootScope = $injector.get("$rootScope"); + $rootScope.exceptionMessage({reason:exception, cause:cause}); + + $delegate(exception, cause); + + }; + }]); + // If you do this, Allow Origin can't be * //$httpProvider.defaults.withCredentials = true; $httpProvider.interceptors.push('timeoutHttpIntercept'); |
