From 25b55ef65143fde473e2e1d6040b210ad1486041 Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 13 Aug 2026 11:57:12 +0200 Subject: [PATCH] feat(domain): add BadRequestException for invalid request errors --- .../Exceptions/BadRequestException.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/core/DigitalData.MessagingService.Domain/Exceptions/BadRequestException.cs diff --git a/src/core/DigitalData.MessagingService.Domain/Exceptions/BadRequestException.cs b/src/core/DigitalData.MessagingService.Domain/Exceptions/BadRequestException.cs new file mode 100644 index 0000000..aa0bfe9 --- /dev/null +++ b/src/core/DigitalData.MessagingService.Domain/Exceptions/BadRequestException.cs @@ -0,0 +1,21 @@ +namespace DigitalData.MessagingService.Domain.Exceptions +{ + /// + /// Exception thrown when a requested entity is not found. + /// + public class BadRequestException : Exception + { + public BadRequestException(string entityName, object key) : base($"{entityName} with key '{key}' was not found.") + { + } + + public BadRequestException(string message) : base(message) + { + } + + public BadRequestException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} \ No newline at end of file