How to enable Pause On Uncaught Exceptions in Google Chrome Canary?

This article talks about including pauses in exceptions. https://developer.chrome.com/devtools/docs/javascript-debugging

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

enter image description here

I get Uncaught SyntaxError: Unexpected token :, search in a location (e.g. VM272), and it is very difficult to track it without a trace of the call stack.

enter image description here

I searched and found that I can add

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

In the console, but that does not give me a stack trace. The Scope window provides a lot of variable information, but I'm still a little lost.

enter image description here

+6
source share
1 answer

The document is a bit outdated.

In newer versions of Chrome, the pause on exception button no longer switches between three states ( disabled , Pause on exceptions , Pause on Uncaught Exceptions ), but only between two states ( disabled and Pause on exception ).

To be able to break into detected exceptions as well , they checked this box (this is useful if you have a global exception handler in GWT , but still want to break when an exception is thrown).

So, if you do not catch the exception, then the settings that you showed in the screenshot should work.

+2
source

Source: https://habr.com/ru/post/984249/


All Articles