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.
- 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
- 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?
source
share