galaeth-draft/Galaeth.Services/Exceptions/UnauthorizedException.cs
2024-11-17 09:31:01 +00:00

20 lines
556 B
C#

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)
{
}
}