To break on all exceptions, caught or uncaught:
!(this instanceof java.lang.ClassNotFoundException)
com.myapp.*
(replace this with the namespace prefix of your app)java.*
(note: as per OP's question, leave this out to NOT break on Java libraries)android.*
(as above, leave out to just debug own app code)If you open up the Breakpoints window, it gives you quite a few options to have it conditionally break or not. What you're looking for is the "Class filters" here -- you can specify a wildcard expression with, for example, a Java package path, and it will only break for exceptions generated from matching classes.
To break on all exceptions in your code and other exceptions if uncaught:
This methods filters out the exception types that the runtime throws during normal operation (not very exceptional, are they?). It doesn't use the class filter, since it would filter out too much; bugs in your code often cause runtime classes to throw exceptions (e.g. accessing an array list past the end).
Enable Java Exception BreakPoints / Any exception for uncaught exceptions only.
Add a new Java Exception BreakPoint for the Exception (java.lang)
class for caught and uncaught exceptions. Enable Condition and set it to this:
!(this instanceof java.lang.ClassNotFoundException || this instanceof android.system.ErrnoException || this instanceof java.io.FileNotFoundException || this instanceof javax.net.ssl.SSLHandshakeException || this instanceof javax.net.ssl.SSLPeerUnverifiedException || this instanceof android.system.GaiException || this instanceof java.net.SocketTimeoutException || this instanceof java.net.SocketException || this instanceof java.security.NoSuchAlgorithmException)
Add to the exclusion list in the condition any other non-exceptional exceptions you encounter. (BTW, using java.lang.Exception
is a way of effectively getting a second "Any exception" entry.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With