31 lines
1.4 KiB
C#
31 lines
1.4 KiB
C#
using adas_core.Domain.Enums;
|
|
|
|
namespace adas_core.Application.Exceptions;
|
|
|
|
/// <summary>
|
|
/// Represents an exception that is thrown when an operation is forbidden or access to a resource is denied.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This exception is intended to signal that a requested action violates access rules or restrictions, allowing callers to handle forbidden scenarios distinctly from other error conditions.
|
|
/// </remarks>
|
|
/// <!-- aidoc:v1 sig=2024892 -->
|
|
public class ForbbidenException : Exception
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ForbbidenException"/> class with a specified error message from the <see cref="HttpEnum.ErrorMessage"/> enumeration.
|
|
/// </summary>
|
|
/// <param name="message">The <see cref="HttpEnum.ErrorMessage"/> enumeration value whose integer representation is used as the exception message.</param>
|
|
/// <!-- aidoc:v1 sig=75787d6 body=4448e1d -->
|
|
public ForbbidenException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ForbbidenException"/> class with a specified error message.
|
|
/// </summary>
|
|
/// <param name="message">The message that describes the error.</param>
|
|
/// <!-- aidoc:v1 sig=545f359 body=4448e1d -->
|
|
public ForbbidenException(string message) : base(message)
|
|
{
|
|
}
|
|
} |