On This Page

RestRequestError

Class in Errors · JavaScript & TypeScript

Expected failure of client.rest.request

Reason input means the request object was invalid and nothing was sent, and reason busy means the client's local queue was full. Reason notFound means HTTP 404, and reason rejected means another non-2xx status, with the sanitized Fluxer error in apiError. Reason rateLimit means a required wait would pass the deadline or could not be completed. Reasons network, timeout and response describe transport failures, the deadline and unusable success bodies. Check outcome before repeating a write. Default API calls return it in an Err and Effect calls fail with it. Errors never include the path, query, body, headers or response body

class RestRequestError extends FluxerlyErrorclass RestRequestError
  extends FluxerlyError

Constructor#

Create the failure from its operation, reason and outcome, with optional status, retry wait, API detail, input detail and cause

new RestRequestError(
    options: OperationErrorOptions<"rest.request">
): RestRequestErrornew RestRequestError(
  options: OperationErrorOptions<
    "rest.request"
  >
): RestRequestError

Parameters

options
OperationErrorOptions<"rest.request">

Properties#

_tag#

Stable expected-failure discriminator

readonly _tag: "RestRequestError"

apiError#

Safe classification of why Fluxer rejected the request, or null when the response could not be classified

readonly apiError: ApiErrorDetail | nullreadonly apiError:
  | ApiErrorDetail | null

inputValidation#

Safe explanation of the locally invalid request field, or null when the failure was not an input failure

readonly inputValidation: InputValidationDetail | nullreadonly inputValidation:
  | InputValidationDetail | null

operation#

Requested operation, always rest.request

readonly operation: "rest.request"

outcome#

Whether the request may have reached Fluxer, described by OperationOutcome

readonly outcome: OperationOutcome

reason#

Failure category, described by OperationReason

readonly reason: OperationReason

retryAfterMs#

Usable server-required retry wait in milliseconds, otherwise null

readonly retryAfterMs: number | nullreadonly retryAfterMs:
  | number | null

status#

HTTP status when a response was received, otherwise null

readonly status: number | null

Inherited#

Inherited from FluxerlyError: code, details, hint, toJSON