refactor(domain): remove obsolete exception types
Deleted: - PdfProcessingException: Obsolete, DevExpress exceptions now propagate naturally - SwissQrCodeNotFoundException: Moved to Application layer (feature-specific exception) Rationale: - PdfProcessingException was wrapping library exceptions unnecessarily - Better to let infrastructure exceptions propagate → middleware handles as 500 - SwissQrCodeNotFoundException is application-level concern, not domain
This commit is contained in:
@@ -1,35 +0,0 @@
|
|||||||
namespace DocumentOperator.Domain.Common.Exceptions;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Exception thrown when PDF processing operations fail.
|
|
||||||
/// Maps to HTTP 500 Internal Server Error or 422 Unprocessable Entity in the API layer.
|
|
||||||
/// </summary>
|
|
||||||
[Obsolete("This exception is deprecated. Use more specific exceptions for PDF processing errors.")]
|
|
||||||
public class PdfProcessingException : DomainException
|
|
||||||
{
|
|
||||||
public string Operation { get; }
|
|
||||||
|
|
||||||
public PdfProcessingException(string operation, string message)
|
|
||||||
: base($"PDF processing failed during '{operation}': {message}", "PDF_PROCESSING_ERROR")
|
|
||||||
{
|
|
||||||
Operation = operation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PdfProcessingException(string operation, string message, Exception innerException)
|
|
||||||
: base($"PDF processing failed during '{operation}': {message}", "PDF_PROCESSING_ERROR", innerException)
|
|
||||||
{
|
|
||||||
Operation = operation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PdfProcessingException(string message)
|
|
||||||
: base(message, "PDF_PROCESSING_ERROR")
|
|
||||||
{
|
|
||||||
Operation = "Unknown";
|
|
||||||
}
|
|
||||||
|
|
||||||
public PdfProcessingException(string message, Exception innerException)
|
|
||||||
: base(message, "PDF_PROCESSING_ERROR", innerException)
|
|
||||||
{
|
|
||||||
Operation = "Unknown";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
namespace DocumentOperator.Domain.Exceptions;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Exception thrown when a Swiss QR Code cannot be found in a PDF document.
|
|
||||||
/// </summary>
|
|
||||||
[Obsolete("This exception is deprecated. Use SwissQrCodeNotFoundException instead.")]
|
|
||||||
public sealed class SwissQrCodeNotFoundException : Exception
|
|
||||||
{
|
|
||||||
public SwissQrCodeNotFoundException()
|
|
||||||
: base("No Swiss QR Code found on the last page of the PDF document.")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public SwissQrCodeNotFoundException(string message)
|
|
||||||
: base(message)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public SwissQrCodeNotFoundException(string message, Exception innerException)
|
|
||||||
: base(message, innerException)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user