galaeth-draft/Galaeth.Services/Exceptions/UnauthorizedException.cs

20 lines
556 B
C#
Raw Normal View History

2024-11-17 10:31:01 +01:00
using System.Net;
using Galaeth.Core.Constants;
using Galaeth.Core.Exceptions;
namespace Galaeth.Services.Exceptions;
/// <summary>
/// Thrown when an attempt to perform an unauthorised action occurs.
/// </summary>
public class UnauthorizedException : ServiceException
{
/// <summary>
/// Initializes a new instance of the <see cref="UnauthorizedException"/> class.
/// </summary>
public UnauthorizedException()
: base(CoreErrorCodes.Unauthorized, $"You are not authorized to do that", HttpStatusCode.Unauthorized)
{
}
}