Table of Contents

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

exception Exception

Returns

string

GetHttpResponseBody(Exception)

Retrieves an HTTP response body from the exception.

public static string? GetHttpResponseBody(this Exception exception)

Parameters

exception Exception

Returns

string

GetHttpResponseHeaders(Exception)

Retrieves HTTP response headers from the exception.

public static HttpResponseHeaders? GetHttpResponseHeaders(this Exception exception)

Parameters

exception Exception

Returns

HttpResponseHeaders

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

exception Exception
cancellationToken CancellationToken

Returns

Task

SetHttpResponseBody(Exception, string)

Stores an HTTP response body in the exception.

public static void SetHttpResponseBody(this Exception exception, string body)

Parameters

exception Exception
body string

SetHttpResponseHeaders(Exception, HttpResponseHeaders)

Stores HTTP response headers in the exception.

public static void SetHttpResponseHeaders(this Exception exception, HttpResponseHeaders headers)

Parameters

exception Exception
headers HttpResponseHeaders