Answers for "Display InnerException recursive"

0

Display InnerException recursive

public static class Extensions
{
    public static string GetFullMessage(this Exception ex)
    {
        return ex.InnerException == null 
             ? ex.Message 
             : ex.Message + "\n\n" 
             + ex.InnerException.GetFullMessage();
    }
}
Posted by: Guest on May-19-2021

Browse Popular Code Answers by Language