forked from Azure/azure-functions-host
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HttpException.cs
46 lines (38 loc) · 1.28 KB
/
HttpException.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
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
namespace Microsoft.Azure.WebJobs.Script.WebHost
{
public class HttpException : Exception
{
public HttpException(int httpStatusCode)
{
StatusCode = httpStatusCode;
}
public HttpException(HttpStatusCode httpStatusCode)
{
StatusCode = (int)httpStatusCode;
}
public HttpException(int httpStatusCode, string message) : base(message)
{
StatusCode = httpStatusCode;
}
public HttpException(HttpStatusCode httpStatusCode, string message) : base(message)
{
StatusCode = (int)httpStatusCode;
}
public HttpException(int httpStatusCode, string message, Exception inner) : base(message, inner)
{
StatusCode = httpStatusCode;
}
public HttpException(HttpStatusCode httpStatusCode, string message, Exception inner) : base(message, inner)
{
StatusCode = (int)httpStatusCode;
}
public int StatusCode { get; }
}
}