• Post Reply Bookmark Topic Watch Topic
  • New Topic

Detecting and getting nested exceptions?  RSS feed

 
M Burke
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I do a try catch block, I get the Exception object. Then I want to send the error to a file in a specific format.

But Exception.asString() and Exception.getMessage() do not alwasy work. So I did a Exception.printStackTrace, and found there is a nested exception.

How can I detect and capture the nested exception?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the API for Exception say? Hint, Exception extends Throwable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!