In a Java debugger, how to ignore exceptions never passing through my code -
i'm using intellij idea java development, i'm interested in answers targeting other ides or general concepts debugging java code. because feature i've missed in number of ides, i'm unsure if i've missed workflow concept when transferring debug habits other languages.
let's i'm writing code in myapp.*
while using framework classes somelib.*
. typical stack trace may start in either package , may switch several times between them. let's i'm debugging under assumption there bugs in my code , there aren't in library code. example stack trace (showing class names):
somelib.d (current stack frame) somelib.c myapp.y myapp.x somelib.b somelib.a
normally, i'm not interested in following types of exceptions , not want debugger break on them:
thrown in
somelib.b
, caught insomelib.a
. either library code throwing exceptions handle problematic state inside library or stop application. in latter case, i'm interested in exception message tells me what's wrong.thrown in
somelib.d
, caught insomelib.c
. library code may use exceptions form of logic action tried , alternative route taken in case of problem or code notified problem other means (e.g. returning null reference appropriate).
types of exceptions interested in:
thrown in
somelib.c
orsomelib.d
, not caught insomelib.c
orsomelib.d
. here want debugger break on line inmyapp.y
call codesomelib.c
.thrown in
myapp.x
ormyapp.y
, either caught or uncaught. here want debugger break on line exception thrown.
intellij idea gives me options select wether want break on caught or uncaught exceptions, or both , restrict location exception thrown set of classes. these options don't want break on exception, wether caught or uncaught, long code i've written between place it's thrown , place it's caught, eventually.
you can create 2 exception breakpionts:
- an exception breakpoint hit whenever there exception in
myapp.*
(caught or uncaught). use class filter purpose (look @ here class filters). - an exception breakpoint hit whenever there uncaught exception in either 'somelib.c1
or
somelib.b`. again use class filters restrict breakpoint.
Comments
Post a Comment