Return to Snippet

Revision: 43807
at March 31, 2011 06:35 by ctrlbr34k


Initial Code
public static string InnerMessages(this Exception exception)
{
    var sb = new StringBuilder();

    sb.AppendLine(exception.Message);
    while (exception.InnerException != null)
    {
        exception = exception.InnerException;
        sb.AppendLine(exception.Message);
    }

    return sb.ToString();
}

Initial URL


Initial Description
Extension class for Exception to display all inner messages

Initial Title
Exception management

Initial Tags


Initial Language
C#