| Author |
Message |
Uniwares_AS
Joined: 11 Oct 2007 Posts: 132
|
Posted: Wed Jul 28, 2010 7:10 pm Post subject: Whats the idea? |
|
|
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 |
|
 |
Alex.Davies
Joined: 02 Dec 2008 Posts: 335 Location: Cambridge, uk
|
Posted: Thu Jul 29, 2010 9:55 am Post subject: |
|
|
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 |
|
 |
Uniwares_AS
Joined: 11 Oct 2007 Posts: 132
|
Posted: Thu Jul 29, 2010 12:43 pm Post subject: |
|
|
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 |
|
 |
|
|
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