Steve's Electric Dreams

A BizTalk and .NET Blog

<November 2008>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456


Navigation

Professional

Subscriptions

Post Categories



Wednesday, May 12, 2004 - Posts

Throw vs. Throw

A friend of mine, Phil Canarsky, pointed out something to me today that I wasn't aware of. 

If you catch an exception and then rethrow it like this:

try
{}
catch (Exception ex)
{
   // Do Cleanup
   throw ex;
}

You lose the original stack trace.  You can avoid this by just doing a “throw;“ without specifying the exception.

Here is an article:  http://dotnetguy.techieswithcats.com/archives/004118.shtml

Thank, Phil!

posted Wednesday, May 12, 2004 4:49 AM by swright with 0 Comments




Powered by Dot Net Junkies, by Telligent Systems