26 lines
1.1 KiB
C#
26 lines
1.1 KiB
C#
using adas_core.Domain.Enums;
|
|
|
|
namespace adas_core.Application.Exceptions;
|
|
|
|
/// <summary>
|
|
/// Represents an exception that is thrown when a bad or invalid request is received.
|
|
/// It serves as a specialized error type derived from the base <see cref="Exception"/> class for signaling client-side request failures.
|
|
/// </summary>
|
|
public class BadRequestException : Exception
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="BadRequestException"/> class with a specified error message.
|
|
/// </summary>
|
|
/// <param name="message">The error message defined in <see cref="HttpEnum.ErrorMessage"/> that describes the reason for the exception.</param>
|
|
public BadRequestException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="BadRequestException"/> class with a specified error message.
|
|
/// </summary>
|
|
/// <param name="message">The error message that describes the reason for the exception.</param>
|
|
public BadRequestException(string message) : base(message)
|
|
{
|
|
}
|
|
} |