Is there any way I can have one handler for multiple exceptions?

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Jul 12 11:39:20 PDT 2011


On 7/12/11, Steven Schveighoffer <schveiguy at yahoo.com> wrote:
> Call a function?
> void main()
> {
>     void handleEx(Exception e)
>     {
>        // exception handling code here
>     }
>
>     try
>     {
>     }
>     catch(Foo f)
>     {
>        handleEx(f);
>     }
>     catch(Bar b)
>     {
>        handleEx(b);
>     }
> }

Yeah that's what I did finally.

>
> Another option is *shudders* goto.
>
> -Steve
>

Get outta here! :p


More information about the Digitalmars-d-learn mailing list