6

In this article it talks about turning on pausing on uncaught exceptions. https://developer.chrome.com/devtools/docs/javascript-debugging

I can only see Pause On Caught Exceptions in both Chrome and Canary. I'm using Chrome Canary Version 43.0.2344.2 canary (64-bit).

enter image description here

I'm getting a Uncaught SyntaxError: Unexpected token :, sourcing to a location (e.g. VM272) and it's very difficult to track down without a trace of the call stack.

enter image description here

I've searched and found that I can add

> window.onerror = function() { debugger;}

In the console, but that doesn't get me a stack trace. The Scope window does provide a lot of variable info, but I'm still a bit lost.

enter image description here

dfdumaresq
  • 1,618
  • 4
  • 17
  • 22

1 Answers1

3

The docuemntation is a little bit outdated.

In the new Chrome versions the "pause on exception" button doesn't toggle anymore between 3 states (disabled, "Pause on Exceptions","Pause on Uncaught Exceptions") but only between two states (disabled and "Pause on Exception").

In order to be able to also break on caught exceptions they introduced this checkbox (this is useful if you have a global exception handler in GWT but still want to break when the exception is thrown).

So if you don't catch the exception then the settings you have shown in your screenshot should work.

Ümit
  • 17,379
  • 7
  • 55
  • 74
  • 1
    That sounds reasonable, thanks. But why wouldn't the error, Uncaught SyntaxError, force a pause? – dfdumaresq Mar 26 '15 at 15:59
  • It should. Does it break when you check the "pause on caught exceptions" ? – Ümit Mar 29 '15 at 11:30
  • 1
    No it doesn't. (That would have been too easy.) I should create a new question on how to debug this error. – dfdumaresq Apr 01 '15 at 20:06
  • I have the same problem as OP. this explanation points out what should happen, not what actually does happen (i.e. that uncaught errors do not (just-in-time-style) stop the debugger). – Steven Lu Aug 03 '15 at 16:17
  • 1
    I can confirm, that my debugger does not stop on what seems like Uncaught Exceptions. =( – Olga Jan 28 '16 at 14:17