Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I know that AngularJS by default catches all application exceptions and then logs them to the console. That makes the 'Pause on uncaught exceptions' button in Chrome (which I use a lot) useless.

Many times I encounter small javascript errors in my code (like accessing members on undefined variables) and I'm really used to pausing on the exception and inspecting the situation.

The only solution I have by now is either to put a breakpoint on the code which is triggering the error (impractical) or to use the 'Pause on all exceptions' button, but I have to continue on all errors generated by default by jQuery, Angular and other frameworks, and that's also very nasty.

I also tried overwriting the $exceptionHandler service, and put a breakpoint in it, but I don't have access from the call stack in the function that generated the error.

So, is it possible to use the 'Pause on uncaught exceptions' with AngularJS apps?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You can enable Skip stepping through sources with particular names in DevTools and set it to something like this:

(jquery|angular|diigolet)

enter image description here

share|improve this answer
    
See the new way to find this: stackoverflow.com/a/25576456/26510 –  Peter Ehrlich Jan 14 at 20:54

The "Skip stepping through sources" is no longer available in Chrome, but - there is a new option - you can right click any script in sources/sources and choose 'Blackbox script'. Then you can turn on 'Pause on Caught Exceptions' without worrying about jQuery and other errors. Personally I use it always on jquery.js and angular.js.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.