The Right Approach to Exceptions

deadalnix deadalnix at gmail.com
Sat Feb 18 15:42:29 PST 2012


Le 19/02/2012 00:30, Andrei Alexandrescu a écrit :
> 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?
>
>
> Andrei
>
>

What do you have in mind ?


More information about the Digitalmars-d mailing list