Beispiel #1
0
 public ErrorLog(Exception exception, Boolean handled)
 {
     Date      = DateTime.UtcNow;
     ID        = Date.UntilMicrosecond();
     Exception = new ExceptionData(exception);
     Handled   = handled;
 }
Beispiel #2
0
        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>;
            }
        }