コード例 #1
0
ファイル: ErrorLog.cs プロジェクト: darakeon/dfm
 public ErrorLog(Exception exception, Boolean handled)
 {
     Date      = DateTime.UtcNow;
     ID        = Date.UntilMicrosecond();
     Exception = new ExceptionData(exception);
     Handled   = handled;
 }
コード例 #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>;
            }
        }