ExceptionExtensions Class
- Namespace
- Kampute.HttpClient.Utilities
- Assembly
- Kampute.HttpClient.dll
Definition
Provides extension methods that classify the exceptions of HTTP requests.
public static class ExceptionExtensions- Inheritance
- object
- ExceptionExtensions
Methods
IsTransientNetworkError(this Exception)
Determines whether an exception reports a network failure that a retry could overcome.
public static bool IsTransientNetworkError(this Exception exception)Parameters
exceptionException- The exception of a failed request.
Returns
- bool
trueif the innermost exception reports a transient condition; otherwise,false. The innermost exception reports a transient condition if it is:- A TimeoutException.
- A SocketException for a condition that can clear by itself, such as a refused, reset, or aborted connection, an unreachable host or network, a failed host name resolution, or a temporary lack of local sockets, ports, or buffer space.
- An IOException other than an HTTP/2 or HTTP/3 protocol error, which reports that the connection closed before the response was complete.
- A T:System.Net.WebException, which .NET Framework reports without a SocketException, for a failed connection, send, or receive, a connection closed early, a failed host name resolution, or a timeout.
