2019-12-05 04:57:05 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Common.StatusFeed.Errors
|
|
|
|
|
{
|
|
|
|
|
public class GenericException : IException
|
|
|
|
|
{
|
2020-04-03 23:23:13 +00:00
|
|
|
|
public string ExtraMessage { get; } = string.Empty;
|
2019-12-05 04:57:05 +00:00
|
|
|
|
|
|
|
|
|
public DateTime Timestamp { get; } = DateTime.Now;
|
|
|
|
|
|
2020-04-03 23:23:13 +00:00
|
|
|
|
public string ShortDescription => string.IsNullOrWhiteSpace(ExtraMessage) ? Exception?.Message ?? string.Empty : $"{ExtraMessage} - {Exception?.Message}";
|
2019-12-05 04:57:05 +00:00
|
|
|
|
|
2020-04-03 23:23:13 +00:00
|
|
|
|
public string ExtendedDescription => string.IsNullOrWhiteSpace(ExtraMessage) ? Exception?.ToString() ?? string.Empty : $"{ExtraMessage} - {Exception?.ToString()}";
|
2019-12-05 04:57:05 +00:00
|
|
|
|
|
|
|
|
|
public Exception Exception { get; }
|
|
|
|
|
|
2020-04-03 23:23:13 +00:00
|
|
|
|
public GenericException(Exception exception, string? extraMessage = null)
|
2019-12-05 04:57:05 +00:00
|
|
|
|
{
|
2020-04-03 23:23:13 +00:00
|
|
|
|
ExtraMessage = extraMessage ?? string.Empty;
|
2019-12-05 04:57:05 +00:00
|
|
|
|
Exception = exception;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|