Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
WebException.cs
Go to the documentation of this file.
6
7namespace System.Net;
8
10[TypeForwardedFrom("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
12{
13 private readonly WebExceptionStatus _status = WebExceptionStatus.UnknownError;
14
15 private readonly WebResponse _response;
16
18
20
21 public WebException()
22 {
23 }
24
25 public WebException(string? message)
26 : base(message)
27 {
28 }
29
30 public WebException(string? message, Exception? innerException)
32 {
33 }
34
35 public WebException(string? message, WebExceptionStatus status)
36 : this(message, null, status, null)
37 {
38 }
39
41 : base(message, innerException)
42 {
43 _status = status;
45 if (innerException != null)
46 {
48 }
49 }
50
55
60
65
67 {
69 {
70 return new WebException(exception.Message, exception, GetStatusFromException(ex), null);
71 }
73 {
74 return new WebException(System.SR.net_webstatus_Timeout, null, WebExceptionStatus.Timeout, null);
75 }
76 return exception;
77 }
78
80 {
81 if (!(ex.InnerException is SocketException { SocketErrorCode: var socketErrorCode }))
82 {
83 return WebExceptionStatus.UnknownError;
84 }
85 if (socketErrorCode == SocketError.HostNotFound || socketErrorCode == SocketError.NoData)
86 {
87 return WebExceptionStatus.NameResolutionFailure;
88 }
89 return WebExceptionStatus.UnknownError;
90 }
91
93 {
94 int hResult = ex.HResult;
95 if (hResult == -2147012889)
96 {
97 return WebExceptionStatus.NameResolutionFailure;
98 }
100 }
101}
static WebExceptionStatus GetStatusFromExceptionHelper(HttpRequestException ex)
WebException(SerializationInfo serializationInfo, StreamingContext streamingContext)
WebException(string? message)
static Exception CreateCompatibleException(Exception exception)
readonly WebExceptionStatus _status
static WebExceptionStatus GetStatusFromException(HttpRequestException ex)
WebExceptionStatus Status
WebException(string? message, Exception? innerException, WebExceptionStatus status, WebResponse? response)
override void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
WebException(string? message, Exception? innerException)
WebException(string? message, WebExceptionStatus status)
readonly WebResponse _response
static string net_webstatus_Timeout
Definition SR.cs:46
Definition SR.cs:7
void GetObjectData(SerializationInfo info, StreamingContext context)