Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66bbfec

Browse files
committed
better error reporting for exceptions
1 parent 2992b40 commit 66bbfec

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

test/mocks.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
* See {@link angular.mock} for more info on angular mocks.
2929
*/
3030
var $logMock = {
31-
log: function(){ $logMock.log.logs.push(arguments); },
32-
warn: function(){ $logMock.warn.logs.push(arguments); },
33-
info: function(){ $logMock.info.logs.push(arguments); },
34-
error: function(){ $logMock.error.logs.push(arguments); }
31+
log: function(){ $logMock.log.logs.push(concat([], arguments, 0)); },
32+
warn: function(){ $logMock.warn.logs.push(concat([], arguments, 0)); },
33+
info: function(){ $logMock.info.logs.push(concat([], arguments, 0)); },
34+
error: function(){ $logMock.error.logs.push(concat([], arguments, 0)); }
3535
};
3636
$logMock.log.logs = [];
3737
$logMock.warn.logs = [];

test/testabilityPatch.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ afterEach(function() {
103103
if ($logMock[logLevel].logs.length) {
104104
forEach($logMock[logLevel].logs, function(log) {
105105
forEach(log, function deleteStack(logItem) {
106-
if (logItem instanceof Error) delete logItem.stack;
106+
if (logItem instanceof Error) {
107+
dump(logItem.stack);
108+
delete logItem.stack;
109+
delete logItem.arguments;
110+
} else {
111+
dump(logItem);
112+
}
107113
});
108114
});
109115

0 commit comments

Comments
 (0)