This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes nested exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "nested exception" Watch "nested exception" New topic

nested exception

rakesh kadulkar
Ranch Hand

Joined: Jul 24, 2008
Posts: 115

I dont understand that why there is a nested exception in the programming.


Why this is done in the code.

Rakesh Kadulkar
Chinna Eranna
Ranch Hand

Joined: Dec 08, 2009
Posts: 174

There will be cases where.. Applications will have there own specific exceptions defined.

In that case.. they catch the predefined exception, create their own exception and throw it back.

- Chinna
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 41104
Welcome to JavaRanch

In most cases where you throw a new Exception, you can pass the old Exception to its constructor and both Exceptions can be passed together.
Consider Paul's rocket mass heater.
subject: nested exception