Andrej Mitrovic wrote:
Actually, would this be safe to use? :

    try
    {
        fun();
    }
    catch (Exception e)
    {
        writeln("Primary exception: ", typeid(e));
while ((e = cast(Exception)e.next) !is null)
        {
            writeln("Collateral exception: ", typeid(e));
} }


I'm no expert, but why shouldn't? I'd propose a correction though:

while ((e = e.next) !is null)
{
    if (cast(Exception)e)
    {
        writeln(/*whatever*/);
    }
}

Reply via email to