Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome paused on exception within a try/catch block, how to auto resume?

I'm using PrimeFaces (3.2), but the question is related to Chrome I think.

Everything is ok unless I opened the Chrome debug window. I.e., if I close the debug window, no error occurred, no exception at all (see below, exception is try/catch-ed).

However, if I openned the Chrome debug window, and do something with the web page, then the debugger paused at following location:

if ( !Sizzle.isXML( node ) ) {
    try { 
        if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
            var ret = matches.call( node, expr ); <----- Paused here.

            // IE 9's matchesSelector returns false on disconnected nodes
            if ( ret || !disconnectedMatch ||
                    // As well, disconnected nodes are said to be in a document
                    // fragment in IE 9, so check for that
                    node.document && node.document.nodeType !== 11 ) {
                return ret;
            }
        }
    } catch(e) {}
}

Here node=<div ... and expr=:hidden. After investigated to the jQuery source code, it seems Chrome don't support node.querySelectorAll(':hidden'),.

Why Chrome will pause here, in the try/catch block? And how to make it not pause any more?

Chrome version: 17

like image 944
Xiè Jìléi Avatar asked Mar 19 '12 05:03

Xiè Jìléi


People also ask

How do I stop chrome from pausing debugger?

The Best Answer is. One possible cause, it that you've enabled the "pause on exceptions" (the little stop-sign shaped icon with the pause (||) symbol with in in the lower left of the window). Try clicking that back to the off/grey state (not red nor blue states) and reload the page.

What is pause on exception?

Pausing on exceptions pauses the code whenever an exception is thrown. This can help us find errors in our code. A stack trace traces where an error comes from. We can see the stack trace of an exception below the "Pause on caught exceptions" option.


1 Answers

Have you unknowingly enabled "pause on exceptions" option in the Scripts tab of the Developer Console? It's the fourth icon from the left in this screenshot:

screenshot

If the icon is highlighted blue, that means it's enabled, and any exceptions will cause the script to pause as if you'd set a breakpoint there, so you can debug it.

like image 199
Jason Hall Avatar answered Oct 19 '22 06:10

Jason Hall