Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get firebug to break on exception?

Tags:

I'm using Firebug 1.5.4. When I reference an undefined variable or some such, it breaks right where the problem occurs, and throws me into the debug view where I can see the stack and inspect variables.

However, when I throw my own exception, it just takes me to the console and prints out "uncaught exception: blah". I'd like it to break and let me inspect variables. How can I tell Firebug to do this?

like image 957
Kevin Pauli Avatar asked Sep 20 '10 19:09

Kevin Pauli


2 Answers

Install Firebug 1.6b1 http://getfirebug.com/releases/firebug/1.6X, Firebug > Console > "the exception" Click the breakpoint selector in the left column. Run your code. Firebug breaks on that line.

Or Firebug > Console > [||] breaks on next error

like image 52
johnjbarton Avatar answered Oct 05 '22 01:10

johnjbarton


The respondent was helpful but neglected something very key I was missing; the window.onerror event. Here is the full code:

 window.onerror = function(msg) {    debugger;  } 
like image 35
Kevin Pauli Avatar answered Oct 05 '22 00:10

Kevin Pauli