You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Matzelle, Brent" <bm...@traffic.com> on 2004/09/01 19:21:31 UTC
Unmanaged code exception patch
Hello Everyone,
I attached a patch (diff.txt) to this message for a bug found in
src/ObjectRenderer/DefaultRenderer.cs in the
DefaultRenderer.RenderException method. The bug occurs when an
unamanged object throws an exception the Source property throws an
exception. This is a bug in C++ .NET in the .NET Framework 1.1.
Here is the snippet of code:
-------------------------------------------------------------
// If a C++ .NET exception was thrown from an unmanaged
// object then the Source property will throw an exception.
try
{
if (ex.Source != null && ex.Source.Length > 0)
{
writer.Write("Source: ");
writer.WriteLine(ex.Source);
}
}
catch
{
writer.WriteLine("Source: None (Exception occurred)");
}
-------------------------------------------------------------
The patch I've attached is built against Rev 1.3 in CVS so you should be
able to add it in very easily.
Best regards,
Brent.
--
Brent R. Matzelle
Senior Software Developer
Mobility Technologies
610.407.7400 x2108