forked from stevenh/HttpServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HttpException.cs
38 lines (35 loc) · 1.18 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
using System;
using System.Net;
namespace HttpServer
{
/// <summary>
/// Exception thrown from HTTP server.
/// </summary>
public class HttpException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="HttpException"/> class.
/// </summary>
/// <param name="code">HTTP status code.</param>
/// <param name="errMsg">Exception description.</param>
public HttpException(HttpStatusCode code, string errMsg) : base(errMsg)
{
Code = code;
}
/// <summary>
/// Initializes a new instance of the <see cref="HttpException"/> class.
/// </summary>
/// <param name="code">HTTP status code.</param>
/// <param name="errMsg">Exception description.</param>
/// <param name="inner">Inner exception.</param>
protected HttpException(HttpStatusCode code, string errMsg, Exception inner)
: base(errMsg, inner)
{
Code = code;
}
/// <summary>
/// Gets HTTP status code.
/// </summary>
public HttpStatusCode Code { get; private set; }
}
}