Files
adas-core/adas-core.Application/Exceptions/UnprocessableEntityException.cs
T

31 lines
1.3 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>
/// <!-- aidoc:v1 sig=70bdc1a -->
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>
/// <!-- aidoc:v1 sig=c2da948 body=4448e1d -->
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>
/// <!-- aidoc:v1 sig=cc0f943 body=4448e1d -->
public UnprocessableEntityException(string message) : base(message)
{
}
}