Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception wraping

 
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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!