Debugger - Break on exception


My only real use case for the debugger is to have it break on exceptions, so when an exception is raised it stops and shows me the location and exception so I wondered whether this is possible?

I've looked at the breakpoint functionality for exceptions but I'm not sure how useful that is when compared to breaking on exceptions.



Comment actions Permalink

Hello Colin,

Yes, exception breakpoints seems to be exactly what you are looking for. Learn more about them here:


Comment actions Permalink

I must be missing something regarding these exception breakpoints, I'll give you an example just to check if I'm misunderstanding your use (as they're not really documented in the linked page and my searches brought up no useful references).

Lets say I have this code:

String.class_eval { define_method(screaming_caps) { upcase } }
p "dsdasda".screaming_caps
If I try to run I get told clearly whats wrong "undefined local variable or method `screaming_caps' for String:Class (NameError)". However I try to debug anyway, I've setup an exception breakpoint for NameError but nothing happens, the debug window shows but nothing appears so I have no idea whats going on. In fact in this situation the debugger is useful, I don't get any output telling me what went wrong.

Note this is against 3.2 beta.


Please sign in to leave a comment.