Conclusions of the exception discussion

Daniel Murphy yebblies at nospamgmail.com
Sat Feb 25 18:23:15 PST 2012


"deadalnix" <deadalnix at gmail.com> wrote in message news:jib71o$1v05
>
> Wow, it didn't got that. This is nice, but then, the Exception type is 
> completely lost.
>
> It does means that we are not interested in the Exception type, but of its 
> presence, and so, maybe we just have created useless Exception types and 
> this has to be fixed instead of the language ?

I don't expect to solve every issue with exceptions with this patch.

The main use is for when a set of different exceptions need to be handled 
the same way, but the common supertype includes other exceptions you don't 
want to catch.

Eg. you might want to catch three types of FileException and two types of 
SocketException and do some common error handling, but don't want to catch 
_every_ type of either, or the entire IOException tree.  If you want to 
access specific data from a subclass, make a different catch block for it, 
or downcast. 




More information about the Digitalmars-d mailing list