Table of Contents

Interface IErrorHandler

Namespace
TypedRest.Errors
Assembly
TypedRest.dll

Handles errors in HTTP responses.

public interface IErrorHandler

Methods

HandleAsync(HttpResponseMessage)

Throws appropriate Exceptions based on HTTP status codes and response bodies.

Task HandleAsync(HttpResponseMessage response)

Parameters

response HttpResponseMessage

Returns

Task

Exceptions

InvalidDataException

BadRequest

AuthenticationException

Unauthorized

UnauthorizedAccessException

Forbidden

KeyNotFoundException

NotFound or Gone

InvalidOperationException

Conflict, PreconditionFailed or RequestedRangeNotSatisfiable

HttpRequestException

Other non-success status code.