The Right Approach to Exceptions

Andrei Alexandrescu SeeWebsiteForEmail at
Mon Feb 20 13:05:42 PST 2012

On 2/20/12 2:31 PM, Juan Manuel Cabo wrote:
>> ...
>> Sure. Again, this is not advocating replacement of exception hierarchies with tables!
>> ...
>> Andrei
> I think that the case of rethrowing an exception with added detail is the worst
> enemy of clean Exception hierarchies.
> The idea of Variant[string] remedies that case without creating a new exception
> class just for the added fields. If that case is solved, then the tipical need
> for creating new exception types that don't really aid selecting them for
> catching and recovery is solved too.

Good point. One thing somewhat particular to D, you can always throw a 
new exception linked to the current one.


More information about the Digitalmars-d mailing list