April 2017
Intermediate to advanced
564 pages
24h 7m
English
LoggingHelper is a helper class, which will be used throughout the project to log the exception and read the complete stack trace about the exception:
public static class LoggerHelper { public static string GetExceptionDetails(Exception ex) { StringBuilder errorString = new StringBuilder(); errorString.AppendLine("An error occured. "); Exception inner = ex; while (inner != null) { errorString.Append("Error Message:"); errorString.AppendLine(ex.Message); errorString.Append("Stack Trace:"); errorString.AppendLine(ex.StackTrace); inner = inner.InnerException; } return errorString.ToString(); } }
Read now
Unlock full access