/ Published in: C#
Extension class for Exception to display all inner messages
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public static string InnerMessages(this Exception exception) { sb.AppendLine(exception.Message); while (exception.InnerException != null) { exception = exception.InnerException; sb.AppendLine(exception.Message); } return sb.ToString(); }