Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Why wrapped exceptions?
Why wrapped exceptions? [message #415812] Tue, 08 January 2008 12:17 Go to next message
Jasper is currently offline JasperFriend
Messages: 84
Registered: July 2009
Member
What's the reason for wrapping checked exceptions such as
PackageNotFoundException in an unchecked WrappedException? Why not just
make PackageNotFoundException an unchecked exception?

I ask because I find myself writing clumsy code unwrapping, inspecting,
then rethrowing or handling depending on what was wrapped.

Thanks,
Jasper.
Re: Why wrapped exceptions? [message #415820 is a reply to message #415812] Tue, 08 January 2008 13:54 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Jasper,

I assume the thinking was that they are much like SAXParseException
which require similar such handling; of course those are wrapped in yet
more layers. In the end, we need to make them all look like
IOExceptions and hence the wrapping. You might ask why not make them
IOExceptions, but I don't know the answer to that either...


Jasper wrote:
> What's the reason for wrapping checked exceptions such as
> PackageNotFoundException in an unchecked WrappedException? Why not
> just make PackageNotFoundException an unchecked exception?
>
> I ask because I find myself writing clumsy code unwrapping,
> inspecting, then rethrowing or handling depending on what was wrapped.
>
> Thanks,
> Jasper.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:BasicEMap not an InternalEObject?
Next Topic:Transitivity in referencing genmodels
Goto Forum:
  


Current Time: Tue Apr 23 15:17:22 GMT 2024

Powered by FUDForum. Page generated in 0.02929 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top