Search for the real source of the exception created in angular.mock.exceptionHandlerProvider

I am trying to contribute to angularjs and I made a mistake somewhere. On the console output of the karma module tests, I see the following:

    Uncaught TypeError: Object #<Object> has no method 'then'
at /Users/me/dev/angular.js/src/ngMock/angular-mocks.js:246

The line to which this error leads me is a line in angular.mock.$ExceptionHandlerProvider.mode, in the case rethrow. So this thing handles the exception, but how do I know where it came from? I know this means that I am expecting a promise in $ q somewhere, but not getting it, but I want to know where in my code this is happening.

+3
source share
1 answer

Try adding try..catch to the place where it was thrown and trace the stack trace

try {
  // line 246 in angular-mocks.js
} catch(e) {
  console.log(e.stack);
}

try..catch, , .

+2

All Articles