feat(domain): add domain exception hierarchy
- DomainException: Base exception for all domain errors - ValidationException: Business rule validation failures - AttachmentProcessingException: Attachment-specific processing errors Exceptions maintain error code compatibility with legacy system.
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
using DigitalData.EmailProfiler.Domain.Enums;
|
||||||
|
|
||||||
|
namespace DigitalData.EmailProfiler.Domain.Exceptions;
|
||||||
|
|
||||||
|
public class AttachmentProcessingException : DomainException
|
||||||
|
{
|
||||||
|
public ErrorCode ErrorCode { get; }
|
||||||
|
|
||||||
|
public AttachmentProcessingException(ErrorCode errorCode, string message) : base(message)
|
||||||
|
{
|
||||||
|
ErrorCode = errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AttachmentProcessingException(ErrorCode errorCode, string message, Exception innerException)
|
||||||
|
: base(message, innerException)
|
||||||
|
{
|
||||||
|
ErrorCode = errorCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace DigitalData.EmailProfiler.Domain.Exceptions;
|
||||||
|
|
||||||
|
public class DomainException : Exception
|
||||||
|
{
|
||||||
|
public DomainException(string message) : base(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public DomainException(string message, Exception innerException) : base(message, innerException)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace DigitalData.EmailProfiler.Domain.Exceptions;
|
||||||
|
|
||||||
|
public class ValidationException : DomainException
|
||||||
|
{
|
||||||
|
public ValidationException(string message) : base(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationException(string message, Exception innerException) : base(message, innerException)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user