DIP33: A standard exception hierarchy

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Apr 2 06:43:20 PDT 2013


On 4/2/13 7:59 AM, Dmitry Olshansky wrote:
> 02-Apr-2013 15:35, Andrei Alexandrescu пишет:
>> On 4/2/13 7:24 AM, Dmitry Olshansky wrote:
>>> You might want to add Visitor pattern to Exceptions but it's darn messy
>>> to deal with and is an overkill most of the time.
>>
>> Actually I think that's a good thing to do.
>>
>
> Why would be that? It doesn't solve the key problem of "try clause plus
> a ton of semi-identical catches" used just to perform a mapping of X
> handlers to Y subsets of errors. Plus visitor does the same dispatch
> that is already addressed by exception handlers (or partly so).

Visitor allows centralized and flexible handling of exceptions.

> If somebody comes up with a reasonable Visitor pattern for Exceptions
> that is flexible and fast then sure let's see it. I just doubt it'll
> help anything on its own in any case.

Well I think exceptions + factory + visitor is quite the connection.


Andrei


More information about the Digitalmars-d mailing list