What's the best way to find out which exceptions may be thrown ?

wjoe invalid at example.com
Wed May 27 09:40:08 UTC 2020


nothrow void foo()
{
    bar(4);
}

void bar(int a)
{
   if (a ==1)
     throw new Exception1();
   else if (a == 2)
     throw new Exception2();

    baz();
}

void baz()
{
   if (whatever)
     throw new Exception3();
}


The compiler will complain that bar(int) isn't nothrow.

What's the best way to find out which Exceptions aren't handled 
inside of foo() for foo to be able to be nothrow without using a 
'catch (Exception){}' catch-all?



More information about the Digitalmars-d-learn mailing list