public ErrorLog(Exception exception, Boolean handled) { Date = DateTime.UtcNow; ID = Date.UntilMicrosecond(); Exception = new ExceptionData(exception); Handled = handled; }
public ExceptionData(Exception exception) { ClassName = exception.GetType().FullName; Message = exception.Message; StackTrace = exception.StackTrace; Source = exception.Source; if (exception.InnerException != null) { InnerException = new ExceptionData( exception.InnerException ); } var prop = exception.GetType() .GetProperty("ValidationErrors"); if (prop != null) { Details = prop.GetValue(exception) as ReadOnlyCollection <String>; } }