Exception Hierarchy [WAS: Re: Top 5]

Benji Smith dlanguage at benjismith.net
Thu Oct 9 14:13:14 PDT 2008


Sean Kelly wrote:
> With this in mind, I'd like to solicit opinions about how exceptions 
> should be categorized.  Should unrecoverable exceptions derive directly 
> from "Exception" with a sibling named something like 
> "RecoverableException" as the parent for recoverable exceptions?  Or 
> would a bit more structure be better?  I don't think it should be the 
> runtime's responsibility to define a complex exception hierarchy, but 
> there is clearly a desire to at least retain some distinction between 
> recoverable and unrecoverable errors and my naming-fu is not terribly 
> strong.

I don't think the code throwing the exception necessarily knows whether 
or not it's recoverable. Only the caller really knows whether recovery 
is possible.

--benji



More information about the Digitalmars-d mailing list