Whats the idea?

Uniwares_ASUniwares_AS Posts: 168
edited July 29, 2010 7:43AM in SmartAssembly 5
While browsing a protected assembly I just found that SA created the following construct, whats the idea of that?
public static void xx()
{
    try
    {
        try
        {
            xx3.xx();
        }
        catch (Exception)
        {
        }
    }
    catch (Exception exception2)
    {
        UnhandledException.xx(exception2);
        throw;
    }
}

Comments

  • Is the inner try-catch block there in the original source code?

    The outer one is applied to all methods (it isn't worth checking for cases like this where it has no effect) to capture variables for the error reporting.
    Alex
    Developer,
    Red Gate .NET Tools
  • No, there is no try/catch at all. And as I could see, in pretty much every ctor SA seems to insert this preventive catch all, even in emtpy and default ctors. but only the ctors with code in it actually have the outer catch.
    Seems pretty weird to me.
Sign In or Register to comment.