Class ExceptionExtensions
- Namespace
- TypedRest
- Assembly
- TypedRest.dll
Provides extension methods for Exception.
public static class ExceptionExtensions
- Inheritance
-
ExceptionExtensions
- Inherited Members
Methods
GetFullMessage(Exception)
Concatenates the Messages of the entire InnerException tree.
public static string GetFullMessage(this Exception exception)
Parameters
exceptionException
Returns
GetHttpResponseBody(Exception)
Retrieves an HTTP response body from the exception.
public static string? GetHttpResponseBody(this Exception exception)
Parameters
exceptionException
Returns
GetHttpResponseHeaders(Exception)
Retrieves HTTP response headers from the exception.
public static HttpResponseHeaders? GetHttpResponseHeaders(this Exception exception)
Parameters
exceptionException
Returns
HttpRetryDelayAsync(Exception, CancellationToken)
Waits for the duration specified in Retry-After header if it was set.
public static Task HttpRetryDelayAsync(this Exception exception, CancellationToken cancellationToken = default)
Parameters
exceptionExceptioncancellationTokenCancellationToken
Returns
SetHttpResponseBody(Exception, string)
Stores an HTTP response body in the exception.
public static void SetHttpResponseBody(this Exception exception, string body)
Parameters
SetHttpResponseHeaders(Exception, HttpResponseHeaders)
Stores HTTP response headers in the exception.
public static void SetHttpResponseHeaders(this Exception exception, HttpResponseHeaders headers)
Parameters
exceptionExceptionheadersHttpResponseHeaders