-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBadRequestException.cs
56 lines (51 loc) · 1.83 KB
/
BadRequestException.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>
/// Represents an instance of a bad request.
/// </summary>
[Serializable]
[ExcludeFromCodeCoverage]
public class BadRequestException : BaseHttpException
{
/// <summary>
/// Creates a new instance of the BadRequestException class.
/// </summary>
public BadRequestException()
{
}
/// <summary>
/// Creates a new instance of the BadRequestException class.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="errorCode"></param>
public BadRequestException(string? message, int errorCode) : base(message, errorCode)
{
}
/// <summary>
/// Creates a new instance of the BadRequestException class.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="innerException">The inner exception.</param>
/// <param name="errorCode">The error code.</param>
public BadRequestException(string? message, Exception? innerException, int errorCode) : base(message, innerException, errorCode)
{
}
/// <summary>
/// Creates a new instance of the BadRequestException class.
/// </summary>
/// <param name="serializationInfo">The serialization info.</param>
/// <param name="context">The context.</param>
protected BadRequestException(SerializationInfo serializationInfo, StreamingContext context) : base(serializationInfo, context)
{
}
/// <inheritdoc />
public override HttpStatusCode GetHttpStatusCode()
{
return HttpStatusCode.BadRequest;
}
}
}