Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn on Pause On Uncaught Exceptions in Google Chrome Canary?

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

like image 233
dfdumaresq Avatar asked Mar 25 '15 18:03

dfdumaresq


People also ask

How do I pause inspect element in Chrome?

Hit F8 on Windows/Linux (or fn + F8 on macOS) while the popover is showing. If you have clicked anywhere on the actual page F8 will do nothing. Your last click needs to be somewhere in the inspector, like the sources tab.

How do I pause a chrome request?

Pausing script execution is F8 (when looking at the Sources tab, as of Chrome 45) or Ctrl + / .

How do I allow exceptions in Chrome?

Click "Advanced" at the bottom of the page, click "Add Exception...", then click an “Confirm Security Exception” button at the bottom of the page and the web page will be added to an exception list.

What is pause on exception?

Just enable 'Pause on exceptions' within the Sources Panel. Optionally, you can also pause on caught exceptions. This means the debugger will pause before that red message appears in the Console and you get a chance to inspect what may have gone wrong.


1 Answers

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.

like image 130
Ümit Avatar answered Oct 27 '22 21:10

Ümit