namespace DocumentOperator.Domain.Common.Exceptions;
///
/// Base exception for all domain-related exceptions.
/// Caught by the Exception Handling Middleware in the API layer.
///
public abstract class DomainException : Exception
{
///
/// Error code for categorization and logging.
///
public string ErrorCode { get; }
protected DomainException(string message, string errorCode)
: base(message)
{
ErrorCode = errorCode;
}
protected DomainException(string message, string errorCode, Exception innerException)
: base(message, innerException)
{
ErrorCode = errorCode;
}
}