RESTCLIENT.NET / API REFERENCE
Outcome.HttpError<TError>.ErrorResponseError
All API types · Outcome · View source
public sealed record ErrorResponseError(TError Body, HttpStatusCode StatusCode, HttpResponseHeaders Headers) : HttpError<TError>
Represents an HTTP error response from the server. This occurs when the server responds with an error status code (4xx, 5xx) but the response body can be parsed into a structured error format. This enables rich error handling where API errors can be strongly typed and contain detailed information about what went wrong.
| Parameter | Type | Default | Description |
|---|---|---|---|
Body |
TError |
Required | The parsed error response body. |
StatusCode |
HttpStatusCode |
Required | The HTTP status code of the error response. |
Headers |
HttpResponseHeaders |
Required | The HTTP response headers. |
Members
.ctor
public ErrorResponseError(TError Body, HttpStatusCode StatusCode, HttpResponseHeaders Headers);
Represents an HTTP error response from the server. This occurs when the server responds with an error status code (4xx, 5xx) but the response body can be parsed into a structured error format. This enables rich error handling where API errors can be strongly typed and contain detailed information about what went wrong.
| Parameter | Type | Default | Description |
|---|---|---|---|
Body |
TError |
Required | The parsed error response body. |
StatusCode |
HttpStatusCode |
Required | The HTTP status code of the error response. |
Headers |
HttpResponseHeaders |
Required | The HTTP response headers. |
View source: Outcome/ErrorResponseError.cs:25
ToString
public override string ToString();
Returns a string representation of the error response.
Returns: A string representation of the error response.
View source: Outcome/ErrorResponseError.cs:35
Body
public TError Body { get; init; }
View source: Outcome/ErrorResponseError.cs:26
Headers
public HttpResponseHeaders Headers { get; init; }
View source: Outcome/ErrorResponseError.cs:28
StatusCode
public HttpStatusCode StatusCode { get; init; }