astral-api/Astral.Services/Exceptions/UnauthorizedException.cs

24 lines
720 B
C#
Raw Normal View History

2024-12-11 21:36:30 +01:00
// <copyright file="UnauthorizedException.cs" company="alveus.dev">
// Copyright (c) alveus.dev. All rights reserved. Licensed under the MIT License.
// </copyright>
using System.Net;
using Astral.Core.Constants;
using Astral.Core.Exceptions;
namespace Astral.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)
{
}
}