Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public static class ExceptionExtensions
{
public static string Details(this Exception exception)
{
StringBuilder builder = new StringBuilder();
builder.AppendLine(exception.Message);
while (exception.InnerException != null)
{
builder.AppendLine(exception.InnerException.Message);
}
builder.AppendLine(exception.StackTrace);
return builder.ToString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment