Cleanup unused directives and add BadRequestException

Removed unnecessary using directives in `UpdateEmailTemplateCommandHandler.cs`. Added a new `BadRequestException` class in `BadRequestException.cs` to handle bad request scenarios with customizable error messages.
This commit is contained in:
Developer 02 2025-05-09 09:56:42 +02:00
parent 8b4ad5e28d
commit 89d6abbb6c
2 changed files with 22 additions and 2 deletions

View File

@ -3,8 +3,6 @@ using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Application.Exceptions;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace EnvelopeGenerator.Application.EmailTemplates.Commands.Update;

View File

@ -0,0 +1,22 @@
namespace EnvelopeGenerator.Application.Exceptions;
/// <summary>
/// Represents an exception that is thrown when a bad request is encountered.
/// </summary>
public class BadRequestException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="BadRequestException"/> class.
/// </summary>
public BadRequestException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="BadRequestException"/> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public BadRequestException(string? message) : base(message)
{
}
}