5using Microsoft.Net.Http.Headers;
27 : base(errorMessage, responseMessage)
29 if (responseMessage ==
null)
30 throw new ArgumentNullException(nameof(responseMessage));
32 if (!responseMessage.Headers.TryGetValues(HeaderNames.RetryAfter, out var values))
35 var secondsString = values.FirstOrDefault();
36 if (UInt32.TryParse(secondsString, out var seconds))
37 RetryAfter = DateTimeOffset.UtcNow.AddSeconds(seconds);
62 : base(message, innerException)
Represents an error message returned by the server.
Occurs when a GitHub rate limit occurs.
RateLimitException()
Initializes a new instance of the RateLimitException class.
DateTimeOffset? RetryAfter
Gets the DateTimeOffset to try the request again after.
RateLimitException(string message)
Initializes a new instance of the RateLimitException class.
RateLimitException(string message, Exception innerException)
Initializes a new instance of the RateLimitException class.
RateLimitException(ErrorMessageResponse? errorMessage, HttpResponseMessage responseMessage)
Initializes a new instance of the RateLimitException class.