- Add [Serializable] attribute to all custom exceptions - Add protected constructors for serialization support - Add XML documentation comments - Update SwissQrCodeNotFoundException message format
26 lines
784 B
C#
26 lines
784 B
C#
namespace DocumentOperator.Domain.Common.Exceptions;
|
|
|
|
/// <summary>
|
|
/// Base exception for all domain-related exceptions.
|
|
/// Caught by the Exception Handling Middleware in the API layer.
|
|
/// </summary>
|
|
[Obsolete("This exception is deprecated. Use more specific exceptions for domain errors.")]
|
|
public abstract class DomainException : Exception
|
|
{
|
|
/// <summary>
|
|
/// Error code for categorization and logging.
|
|
/// </summary>
|
|
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;
|
|
}
|
|
} |