public static string ToLogString(this ServiceFault message) { var sb = new StringBuilder(); sb.AppendLine(message.ExceptionDetail.Message); sb.AppendLine(message.ExceptionDetail.StackTrace); message.InnerExceptions.Each(ed => { sb.AppendLine(ed.Message); sb.AppendLine(ed.StackTrace); }); return(sb.ToString()); }
public static string ToLogString([NotNull] this ServiceFault message) { if (message == null) { throw new ArgumentNullException("message"); } var sb = new StringBuilder(); if (message.ExceptionDetail != null) { AppendDetails(sb, message.ExceptionDetail); } if (message.InnerExceptions != null) { message.InnerExceptions.Each(ed => AppendDetails(sb, ed)); } return(sb.ToString()); }