-
Notifications
You must be signed in to change notification settings - Fork 1
/
ForbiddenException.cs
56 lines (51 loc) · 1.85 KB
/
ForbiddenException.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;
namespace Shared.WebApi.Core.Exceptions
{
/// <summary>
/// An exception to represents a 403 - Forbidden response.
/// </summary>
[Serializable]
[ExcludeFromCodeCoverage]
public class ForbiddenException : BaseHttpException
{
/// <summary>
/// Creates a new instance of the ForbiddenException class.
/// </summary>
public ForbiddenException()
{
}
/// <summary>
/// Creates a new instance of the ForbiddenException class.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="errorCode">The error code.</param>
public ForbiddenException(string? message, int errorCode) : base(message, errorCode)
{
}
/// <summary>
/// Creates a new instance of the ForbiddenException class.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="innerException">The inner exception.</param>
/// <param name="errorCode">The error code.</param>
public ForbiddenException(string? message, Exception? innerException, int errorCode) : base(message, innerException, errorCode)
{
}
/// <summary>
/// Creates a new instance of the ForbiddenException class.
/// </summary>
/// <param name="serializationInfo">The serialization info.</param>
/// <param name="context">The context.</param>
protected ForbiddenException(SerializationInfo serializationInfo, StreamingContext context) : base(serializationInfo, context)
{
}
/// <inheritdoc />
public override HttpStatusCode GetHttpStatusCode()
{
return HttpStatusCode.Forbidden;
}
}
}