How to trigger a debug break in firebug

I am trying to make firebug break when an error is detected. In particular, I have some internal checks in my code, such as claims that I want firebug to stop when they fail. I tried several different ways and wondered what other people are doing. Here is how I tried:

  • Paste the invalid code so that in case of errors: function assert (value) {if (! Value) dbgbreak (); } // Fail because dbgbreak is not defined

This works somewhat, but does not stop the code in such a way that I see the stack or check local variables.

  1. Try this: function assert (value) {if! value) throw AssertExecption (); }

This is prettier, but still, when I track exceptions, I don't see the stack or locals

  1. Put a breakpoint on the assert error. This works, however, this means that every time I run my code, I have to manually put a bunch of breakpoints.

What do other people do in terms of working with the debugger and statements and similar consistency checks?

+3
source share
2 answers

Have you tried resetting the "debugger" keyword in a script, where do you want to stop?

+2
source

There is a button on the console tab to crack all errors. Turn this on and it will break automatically when an error occurs.

http://getfirebug.com/wiki/index.php/Console_Panel#Break_On_All_Errors

+2
source

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


All Articles