public ErrorInfo(Exception exception) { if (exception == null) { throw new ArgumentNullException("exception"); } Id = Guid.NewGuid().ToString(); Exception = exception; Exception baseException = Exception.GetBaseException(); ErrorType = baseException.GetType().FullName; #if !SILVERLIGHT Source = baseException.Source; #endif Detail = exception.GetExceptionString(); Message = baseException.Message; Date = DateTime.Now; }
public ErrorInfo(Exception exception) { if (exception == null) { throw new ArgumentNullException("exception"); } Id = Guid.NewGuid().ToString(); Exception = exception; Exception baseException = Exception.GetBaseException(); ErrorType = baseException.GetType().FullName; #if !SILVERLIGHT Source = baseException.Source; #endif Detail = exception.GetExceptionString(); // Sometimes the message is empty string Message = string.IsNullOrWhiteSpace(baseException.Message) ? baseException.GetType().ToString() : baseException.Message; Date = DateTime.Now; }