Skip to content

Commit c3ed646

Browse files
authored
Fixed "TypeError: undefined is not an object (evaluating '$log.error.logs.push')" error in angular integration
Fixed "TypeError: undefined is not an object (evaluating '$log.error.logs.push')" error in angular integration
2 parents c24d435 + 1a982f1 commit c3ed646

File tree

6 files changed

+15
-3
lines changed

6 files changed

+15
-3
lines changed

dist/exceptionless.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/integrations/angular.js

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ angular.module('exceptionless', [])
3030
function decorateRegularCall(property, logLevel) {
3131
var previousFn = $delegate[property];
3232
return $delegate[property] = function () {
33+
if (angular.mock) {
34+
$delegate[property].logs = [];
35+
}
3336
previousFn.apply(null, arguments);
3437
if (arguments[0] && arguments[0].length > 0) {
3538
$ExceptionlessClient.submitLog(null, arguments[0], logLevel);

src/integrations/angular.ts

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ angular.module('exceptionless', [])
3333
function decorateRegularCall(property, logLevel) {
3434
let previousFn = $delegate[property];
3535
return $delegate[property] = function() {
36+
if (angular.mock) {
37+
// Needed to support angular-mocks.
38+
$delegate[property].logs = [];
39+
}
3640
previousFn.apply(null, arguments);
3741
if (arguments[0] && arguments[0].length > 0) {
3842
$ExceptionlessClient.submitLog(null, arguments[0], logLevel);

src/integrations/tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
},
88
"files": [
99
"../typings/angularjs/angular.d.ts",
10+
"../typings/angularjs/angular-mocks.d.ts",
1011
"../typings/jquery/jquery.d.ts",
1112
"angular.ts"
1213
],
1314
"bundles": {
1415
"angular": {
1516
"files": [
1617
"../typings/angularjs/angular.d.ts",
18+
"../typings/angularjs/angular-mocks.d.ts",
1719
"../typings/jquery/jquery.d.ts",
1820
"angular.ts"
1921
]

tsd.json

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
},
2929
"mock-fs/mock-fs.d.ts": {
3030
"commit": "d969b903d1fce89a5e43828ec68458b4f852db4d"
31+
},
32+
"angularjs/angular-mocks.d.ts": {
33+
"commit": "d969b903d1fce89a5e43828ec68458b4f852db4d"
3134
}
3235
}
3336
}

0 commit comments

Comments
 (0)