diff --git a/DocumentOperator.Domain/Common/Exceptions/DomainException.cs b/DocumentOperator.Domain/Common/Exceptions/DomainException.cs
index 70cdee8..c53ef04 100644
--- a/DocumentOperator.Domain/Common/Exceptions/DomainException.cs
+++ b/DocumentOperator.Domain/Common/Exceptions/DomainException.cs
@@ -4,6 +4,7 @@
/// Base exception for all domain-related exceptions.
/// Caught by the Exception Handling Middleware in the API layer.
///
+[Obsolete("This exception is deprecated. Use more specific exceptions for domain errors.")]
public abstract class DomainException : Exception
{
///
diff --git a/DocumentOperator.Domain/Common/Exceptions/DomainValidationException.cs b/DocumentOperator.Domain/Common/Exceptions/DomainValidationException.cs
index fd13406..847f6ef 100644
--- a/DocumentOperator.Domain/Common/Exceptions/DomainValidationException.cs
+++ b/DocumentOperator.Domain/Common/Exceptions/DomainValidationException.cs
@@ -4,6 +4,7 @@
/// Exception thrown when domain validation fails (e.g., invalid Value Objects).
/// Maps to HTTP 400 Bad Request in the API layer.
///
+[Obsolete("This exception is deprecated. Use more specific exceptions for domain validation errors.")]
public class DomainValidationException : DomainException
{
public string PropertyName { get; }
diff --git a/DocumentOperator.Domain/Common/Exceptions/NotFoundException.cs b/DocumentOperator.Domain/Common/Exceptions/NotFoundException.cs
index 73cd81a..254b3b1 100644
--- a/DocumentOperator.Domain/Common/Exceptions/NotFoundException.cs
+++ b/DocumentOperator.Domain/Common/Exceptions/NotFoundException.cs
@@ -1,25 +1,22 @@
-namespace DocumentOperator.Domain.Common.Exceptions;
+using System.Runtime.Serialization;
+
+namespace DocumentOperator.Domain.Common.Exceptions;
///
/// Exception thrown when a requested resource is not found.
/// Maps to HTTP 404 Not Found in the API layer.
///
-public class NotFoundException : DomainException
+public class NotFoundException : Exception
{
- public string ResourceType { get; }
- public object ResourceId { get; }
-
- public NotFoundException(string resourceType, object resourceId)
- : base($"{resourceType} with ID '{resourceId}' was not found.", "RESOURCE_NOT_FOUND")
+ public NotFoundException()
{
- ResourceType = resourceType;
- ResourceId = resourceId;
}
- public NotFoundException(string resourceType, object resourceId, string customMessage)
- : base(customMessage, "RESOURCE_NOT_FOUND")
+ public NotFoundException(string? message) : base(message)
+ {
+ }
+
+ public NotFoundException(string? message, Exception? innerException) : base(message, innerException)
{
- ResourceType = resourceType;
- ResourceId = resourceId;
}
}
\ No newline at end of file
diff --git a/DocumentOperator.Domain/Common/Exceptions/PdfProcessingException.cs b/DocumentOperator.Domain/Common/Exceptions/PdfProcessingException.cs
index ccd73c8..684a116 100644
--- a/DocumentOperator.Domain/Common/Exceptions/PdfProcessingException.cs
+++ b/DocumentOperator.Domain/Common/Exceptions/PdfProcessingException.cs
@@ -4,6 +4,7 @@
/// 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; }
diff --git a/DocumentOperator.Domain/Exceptions/SwissQrCodeNotFoundException.cs b/DocumentOperator.Domain/Exceptions/SwissQrCodeNotFoundException.cs
index b06eb8a..b24fe08 100644
--- a/DocumentOperator.Domain/Exceptions/SwissQrCodeNotFoundException.cs
+++ b/DocumentOperator.Domain/Exceptions/SwissQrCodeNotFoundException.cs
@@ -3,6 +3,7 @@ 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()