Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

nested exception

 
rakesh kadulkar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

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

i.e.



Why this is done in the code.
 
Chinna Eranna
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic