diff --git a/loggr-dotnet/Utility/ExceptionFormatter.cs b/loggr-dotnet/Utility/ExceptionFormatter.cs index ef9e258..2605b78 100644 --- a/loggr-dotnet/Utility/ExceptionFormatter.cs +++ b/loggr-dotnet/Utility/ExceptionFormatter.cs @@ -90,42 +90,15 @@ public static string Format(Exception ex, object traceObject) res += "
"; res += "Traced Object(s)
"; res += "
"; - if (traceObject != null) - { - res += ObjectDumper.DumpObject(traceObject, 1); - } - else - { - res += "Not specified
"; - } + res += ObjectDumper.DumpObject(traceObject, 1); } res += "
"; res += "Stack Trace
"; res += "
"; - - FormatStack(ex, ref res); + res += string.IsNullOrEmpty(ex.ToString()) ? "No stack trace" : string.Format("
{0}
", ex.ToString()); return res; } - - protected static void FormatStack(Exception Ex, ref string Buffer) - { - if (Ex.InnerException != null) - { - FormatStack(Ex.InnerException, ref Buffer); - } - Buffer += string.Format("[{0}: {1}]
", Ex.GetType().ToString(), Ex.Message); - if (Ex.StackTrace != null) - { - Buffer += HttpUtility.HtmlEncode(Ex.StackTrace).Replace(Environment.NewLine, "
"); - } - else - { - Buffer += "No stack trace"; - } - Buffer += "
"; - Buffer += "
"; - } } } \ No newline at end of file