Helpful utility for searching a Java exception chain for a particular exception type

Sometimes I want to search a chain of exceptions (caught->cause1->cause2…) for an exception of a particular type. This isn’t a difficult problem, but having a simple utility makes it easier:

It’s pretty easy to use:

Leave a Reply

Your email address will not be published. Required fields are marked *