From 2ea3cb7717b1b92d2eb69add416b1a9379155448 Mon Sep 17 00:00:00 2001 From: txavier Date: Fri, 23 Dec 2016 17:17:52 -0500 Subject: [PATCH 1/2] Update to fix "digest already in progress bug" This is to fix the following issue (https://github.com/mperdeck/JSNLog.AngularJS/issues/2). Using the new guidance by the Angular team outlined here (https://github.com/angular/angular.js/issues/14704) and here (https://github.com/angular/angular.js/commit/f82eba814b5fce0c8b541afc3eeadf612d8222f0). --- logToServer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logToServer.js b/logToServer.js index cf11b50..c0b8745 100644 --- a/logToServer.js +++ b/logToServer.js @@ -23,7 +23,7 @@ angular.module('logToServer', []) .factory('$exceptionHandler', function () { return function (exception, cause) { JL('Angular').fatalException(cause, exception); - throw exception; + $log.warn(exception, cause); }; }) .factory('logToServerInterceptor', ['$q', function ($q) { From 9306faffd7096d1f8e866b0ab5a4ded8e41b315e Mon Sep 17 00:00:00 2001 From: txavier Date: Tue, 27 Dec 2016 12:10:41 -0500 Subject: [PATCH 2/2] Update logToServer.js --- logToServer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logToServer.js b/logToServer.js index c0b8745..8fc8d47 100644 --- a/logToServer.js +++ b/logToServer.js @@ -20,12 +20,12 @@ angular.module('logToServer', []) JL('Angular').error(msg); } }) -.factory('$exceptionHandler', function () { +.factory('$exceptionHandler', ['$log', function ($log) { return function (exception, cause) { JL('Angular').fatalException(cause, exception); $log.warn(exception, cause); }; -}) +}]) .factory('logToServerInterceptor', ['$q', function ($q) { var myInterceptor = {