Red Gate forums :: View topic - Whats the idea?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 5
SmartAssembly 5 forum

Whats the idea?

Search in SmartAssembly 5 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Wed Jul 28, 2010 7:10 pm    Post subject: Whats the idea? Reply with quote

While browsing a protected assembly I just found that SA created the following construct, whats the idea of that?

Code:
public static void xx()
{
    try
    {
        try
        {
            xx3.xx();
        }
        catch (Exception)
        {
        }
    }
    catch (Exception exception2)
    {
        UnhandledException.xx(exception2);
        throw;
    }
}
Back to top
View user's profile Send private message MSN Messenger
Alex.Davies



Joined: 02 Dec 2008
Posts: 335
Location: Cambridge, uk

PostPosted: Thu Jul 29, 2010 9:55 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Thu Jul 29, 2010 12:43 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group