-
Notifications
You must be signed in to change notification settings - Fork 14
/
QBittorrentClientRequestException.cs
40 lines (38 loc) · 1.13 KB
/
QBittorrentClientRequestException.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
using System;
using System.Net;
using System.Net.Http;
namespace QBittorrent.Client
{
/// <summary>
/// This exception is thrown if QBittorrent server answers with non-success status code.
/// </summary>
[Serializable]
public class QBittorrentClientRequestException : HttpRequestException
{
/// <summary>
/// Creates a new instance of <see cref="QBittorrentClientRequestException"/>.
/// </summary>
/// <param name="message">The exception message.</param>
/// <param name="statusCode">HTTPS status code.</param>
public QBittorrentClientRequestException(string message, HttpStatusCode statusCode)
#if NET5_0_OR_GREATER
: base(message, null, statusCode)
#else
: base(message)
#endif
{
StatusCode = statusCode;
}
#if NET5_0_OR_GREATER
/// <summary>
/// Gets the HTTP status code.
/// </summary>
public new HttpStatusCode StatusCode { get; }
#else
/// <summary>
/// Gets the HTTP status code.
/// </summary>
public HttpStatusCode StatusCode { get; }
#endif
}
}