From 07be9b9f02a0ed56cf93b395fb282f56ae6b4fe5 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 20 Jul 2026 16:32:36 +0200 Subject: [PATCH] refactor(domain): remove obsolete exception types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../Exceptions/PdfProcessingException.cs | 35 ------------------- .../SwissQrCodeNotFoundException.cs | 23 ------------ 2 files changed, 58 deletions(-) delete mode 100644 DocumentOperator.Domain/Common/Exceptions/PdfProcessingException.cs delete mode 100644 DocumentOperator.Domain/Exceptions/SwissQrCodeNotFoundException.cs diff --git a/DocumentOperator.Domain/Common/Exceptions/PdfProcessingException.cs b/DocumentOperator.Domain/Common/Exceptions/PdfProcessingException.cs deleted file mode 100644 index 684a116..0000000 --- a/DocumentOperator.Domain/Common/Exceptions/PdfProcessingException.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace DocumentOperator.Domain.Common.Exceptions; - -/// -/// Exception thrown when PDF processing operations fail. -/// Maps to HTTP 500 Internal Server Error or 422 Unprocessable Entity in the API layer. -/// -[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"; - } -} \ No newline at end of file diff --git a/DocumentOperator.Domain/Exceptions/SwissQrCodeNotFoundException.cs b/DocumentOperator.Domain/Exceptions/SwissQrCodeNotFoundException.cs deleted file mode 100644 index b24fe08..0000000 --- a/DocumentOperator.Domain/Exceptions/SwissQrCodeNotFoundException.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace DocumentOperator.Domain.Exceptions; - -/// -/// Exception thrown when a Swiss QR Code cannot be found in a PDF document. -/// -[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) - { - } -}