elsa-core/src/core/Elsa.Persistence.Abstractions/Models/SimpleException.cs
Sipke Schoorstra a44ceaeb55
Implement V3 stores (#2980)
* Implement IWorkflowInstanceStore

* Implement IWorkflowDefinitionStore

* Implement IWorkflowTriggerStore

* Implement IWorkflowBookmarkStore

* Implement IWorkflowExecutonLogStore

* Restructure folders

* Persist workflow instance status timestamps
2022-04-30 15:10:11 +02:00

36 lines
1.1 KiB
C#

using System.Collections;
namespace Elsa.Persistence.Models
{
public class SimpleException
{
public SimpleException(Type type, string message, string? stackTrace, IDictionary data, SimpleException? innerException = default)
{
Type = type;
Message = message;
StackTrace = stackTrace;
InnerException = innerException;
Data = data;
}
public Type Type { get; set; }
public string Message { get; set; }
public string? StackTrace { get; set; }
public SimpleException? InnerException { get; set; }
public IDictionary Data { get; set; }
public static SimpleException? FromException(Exception? ex)
{
if (ex == null)
return null;
var exceptionType = ex.GetType();
var simpleException = new SimpleException(exceptionType, ex.Message, ex.StackTrace, ex.Data);
if (ex.InnerException != null)
simpleException.InnerException = FromException(ex.InnerException);
return simpleException;
}
}
}