Guest User

Untitled

a guest
May 21st, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     private StringBuilder BuildExceptionDetail(Exception ex, StringBuilder sb)
  2.     {
  3.         sb.AppendLine("Message: " + ex.Message);
  4.         sb.AppendLine("Source: " + ex.Source);
  5.         sb.AppendLine("TargetSite: " + ex.TargetSite);
  6.         sb.AppendLine("StackTrace: " + ex.StackTrace);
  7.  
  8.         // loop recursivly through the inner exception if there are any.
  9.         if (ex.InnerException != null)
  10.         {
  11.             sb.AppendLine("InnerException: ");
  12.             BuildExceptionDetail(ex.InnerException, sb);
  13.         }
  14.  
  15.         return sb;
  16.     }
Add Comment
Please, Sign In to add comment