This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception wraping  RSS feed

 
sanjeev mehra
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am I correct ?
We catch all kind of exceptions, wrap it into other exception, say RemoteException, and throw that Exception (RemoteException).
We do this because client needs to catch only single exception (RemoteException).
I did something like this in my developer project in 2002, I am following same in my office project, but I stopped thinking why I was doing this.
Just a thought came to mind why we wrap exceptions to other, so I am posting what I guessed. (Easiest way to solve doubts).
Please let me know if I am wrong &/or missing something.
Regards,
Sanjeev.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!