tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
Tgstation.Server.Client.RateLimitException Class Referencesealed

Occurs when a GitHub rate limit occurs. More...

Inheritance diagram for Tgstation.Server.Client.RateLimitException:
Inheritance graph
[legend]
Collaboration diagram for Tgstation.Server.Client.RateLimitException:
Collaboration graph
[legend]

Public Member Functions

 RateLimitException (ErrorMessageResponse? errorMessage, HttpResponseMessage responseMessage)
 Initializes a new instance of the RateLimitException class.
 
 RateLimitException ()
 Initializes a new instance of the RateLimitException class.
 
 RateLimitException (string message)
 Initializes a new instance of the RateLimitException class.
 
 RateLimitException (string message, Exception innerException)
 Initializes a new instance of the RateLimitException class.
 

Properties

DateTimeOffset? RetryAfter [get]
 Gets the DateTimeOffset to try the request again after.
 
- Properties inherited from Tgstation.Server.Client.ApiException
Version? ServerApiVersion [get]
 The Version of the server's API.
 
string? AdditionalServerData [get]
 Additional error data from the server.
 
ErrorCodeErrorCode [get]
 The API ErrorCode if applicable.
 
- Properties inherited from Tgstation.Server.Client.ClientException
HttpResponseMessage? ResponseMessage [get]
 The HttpStatusCode of the ClientException.
 

Additional Inherited Members

- Protected Member Functions inherited from Tgstation.Server.Client.ApiException
 ApiException (ErrorMessageResponse? errorMessage, HttpResponseMessage responseMessage)
 Initializes a new instance of the ApiException class.
 
 ApiException (HttpResponseMessage responseMessage, string message)
 Initializes a new instance of the ApiException class.
 
 ApiException ()
 Initializes a new instance of the ApiException class.
 
 ApiException (string message)
 Initializes a new instance of the ApiException class.
 
 ApiException (string message, Exception innerException)
 Initializes a new instance of the ApiException class.
 
- Protected Member Functions inherited from Tgstation.Server.Client.ClientException
 ClientException (HttpResponseMessage responseMessage, string message)
 Initializes a new instance of the ClientException class.
 
 ClientException ()
 Initializes a new instance of the ClientException class.
 
 ClientException (string message)
 Initializes a new instance of the ClientException class.
 
 ClientException (string message, Exception innerException)
 Initializes a new instance of the ClientException class.
 

Detailed Description

Occurs when a GitHub rate limit occurs.

Definition at line 14 of file RateLimitException.cs.

Constructor & Destructor Documentation

◆ RateLimitException() [1/4]

Tgstation.Server.Client.RateLimitException.RateLimitException ( ErrorMessageResponse errorMessage,
HttpResponseMessage  responseMessage 
)

Initializes a new instance of the RateLimitException class.

Parameters
errorMessageThe ErrorMessageResponse for the ApiException.
responseMessageThe HttpResponseMessage for the ClientException.

Definition at line 26 of file RateLimitException.cs.

27 : base(errorMessage, responseMessage)
28 {
29 if (responseMessage == null)
30 throw new ArgumentNullException(nameof(responseMessage));
31
32 if (!responseMessage.Headers.TryGetValues(HeaderNames.RetryAfter, out var values))
33 return;
34
35 var secondsString = values.FirstOrDefault();
36 if (UInt32.TryParse(secondsString, out var seconds))
37 RetryAfter = DateTimeOffset.UtcNow.AddSeconds(seconds);
38 }
DateTimeOffset? RetryAfter
Gets the DateTimeOffset to try the request again after.

References Tgstation.Server.Client.RateLimitException.RetryAfter.

◆ RateLimitException() [2/4]

Tgstation.Server.Client.RateLimitException.RateLimitException ( )

Initializes a new instance of the RateLimitException class.

Definition at line 43 of file RateLimitException.cs.

44 {
45 }

◆ RateLimitException() [3/4]

Tgstation.Server.Client.RateLimitException.RateLimitException ( string  message)

Initializes a new instance of the RateLimitException class.

Parameters
messageThe message for the Exception.

Definition at line 51 of file RateLimitException.cs.

52 : base(message)
53 {
54 }

◆ RateLimitException() [4/4]

Tgstation.Server.Client.RateLimitException.RateLimitException ( string  message,
Exception  innerException 
)

Initializes a new instance of the RateLimitException class.

Parameters
messageThe message for the Exception.
innerExceptionThe inner Exception for the base Exception.

Definition at line 61 of file RateLimitException.cs.

62 : base(message, innerException)
63 {
64 }

Property Documentation

◆ RetryAfter

DateTimeOffset? Tgstation.Server.Client.RateLimitException.RetryAfter
get

Gets the DateTimeOffset to try the request again after.

Definition at line 19 of file RateLimitException.cs.

19{ get; }

Referenced by Tgstation.Server.Client.RateLimitException.RateLimitException().


The documentation for this class was generated from the following file: