The Right Approach to Exceptions

Andrei Alexandrescu SeeWebsiteForEmail at
Sat Feb 18 15:30:10 PST 2012

On 2/18/12 5:20 PM, Jonathan M Davis wrote:
> On Saturday, February 18, 2012 17:13:16 Andrei Alexandrescu wrote:
>> On 2/18/12 4:26 PM, Jonathan M Davis wrote (abridged):
>> GetOptException
>> FlagArgumentMissingException
>> InvalidFlagArgumentException
>> UnknownFlagException
>> FileException
>> FileNotFoundException
>> NotFileException
>> NotDirException
>> AccessDeniedException
>> I died inside a little.
> If you actually want to _handle_ exceptions, how else do you expect to do it?
> Simply put a code of some kind on the exceptions and then have switch
> statement to handle them?

The alternative is with virtuals. Do you see a lot of virtuals in base 
exceptions? Do you see dramatically different interface for different 
exception types?


More information about the Digitalmars-d mailing list