Files
adas-core/adas-core.Application/Exceptions/UnprocessableEntityException.cs
T
2026-06-26 10:29:23 +02:00

28 lines
1.2 KiB
C#

using adas_core.Domain.Enums;
namespace adas_core.Application.Exceptions;
/// <summary>
/// Represents an exception that is thrown when an entity cannot be processed due to issues with its content or structure.
/// </summary>
/// <remarks>
/// This exception is typically used to signal that a request or entity was understood but could not be processed, similar to the semantics of an HTTP 422 (Unprocessable Entity) response.
/// </remarks>
public class UnprocessableEntityException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="UnprocessableEntityException"/> class with a specified error message enum.
/// </summary>
/// <param name="message">The error message enum containing the error code.</param>
public UnprocessableEntityException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="UnprocessableEntityException"/> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public UnprocessableEntityException(string message) : base(message)
{
}
}