wabbajack/Wabbajack.Common/StatusFeed/Errors/GenericException.cs
Justin Swanson 2c47f54752 IException, GenericException
Adds ability to wrap an existing exception and push it through the pipe
2019-12-04 22:57:05 -06:00

28 lines
724 B
C#

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
{
public string ExtraMessage { get; }
public DateTime Timestamp { get; } = DateTime.Now;
public string ShortDescription => ExtraMessage ?? Exception?.Message;
public string ExtendedDescription => $"{ExtraMessage}: {Exception?.ToString()}";
public Exception Exception { get; }
public GenericException(Exception exception, string extraMessage = null)
{
ExtraMessage = extraMessage;
Exception = exception;
}
}
}