Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
QuicExceptionHelpers.cs
Go to the documentation of this file.
2
3internal static class QuicExceptionHelpers
4{
5 internal static void ThrowIfFailed(uint status, string message = null, Exception innerException = null)
6 {
8 {
9 throw CreateExceptionForHResult(status, message, innerException);
10 }
11 }
12
13 internal static Exception CreateExceptionForHResult(uint status, string message = null, Exception innerException = null)
14 {
15 return new QuicException(message + " Error Code: " + MsQuicStatusCodes.GetError(status), innerException, MapMsQuicStatusToHResult(status));
16 }
17
18 internal static int MapMsQuicStatusToHResult(uint status)
19 {
20 return status switch
21 {
22 2147943625u => 10061,
23 2151743494u => 10060,
24 2147943632u => 10065,
25 _ => 0,
26 };
27 }
28}
static void ThrowIfFailed(uint status, string message=null, Exception innerException=null)
static Exception CreateExceptionForHResult(uint status, string message=null, Exception innerException=null)