On This Page

MessageError

Class in Errors · JavaScript & TypeScript

A send, reply or forward ended without confirming that Fluxer created the message

Inspect outcome before retrying, since unknown means message creation may already have occurred. Even notDispatched or rejected can follow preparatory file uploads and does not prove rollback. Metadata contains no Fluxer response body or message content. A missing-permission rejection lists the permissions that sending needs in details.requiredPermissions, as ApiErrorDetail describes

class MessageError extends FluxerlyErrorclass MessageError
  extends FluxerlyError

Constructor#

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

new MessageError(
    options: {
        readonly apiError?: ApiErrorDetail | null
        readonly cause?: unknown
        readonly inputValidation?: InputValidationDetail | null
        readonly outcome: OperationOutcome
        readonly providerCode?: string | null
        readonly reason:
            | "input" | "network" | "timeout" | "rejected" | "busy"
            | "response" | "rateLimit"
        readonly responseField?: string | null
        readonly retryAfterMs?: number | null
        readonly status?: number | null
    }
): MessageErrornew MessageError(
  options: {
    readonly apiError?:
      | ApiErrorDetail | null
    readonly cause?: unknown
    readonly inputValidation?:
      | InputValidationDetail
      | null
    readonly outcome:
      OperationOutcome
    readonly providerCode?:
      | string | null
    readonly reason:
      | "input" | "network"
      | "timeout" | "rejected"
      | "busy" | "response"
      | "rateLimit"
    readonly responseField?:
      | string | null
    readonly retryAfterMs?:
      | number | null
    readonly status?: number | null
  }
): MessageError

Parameters

options
apiError optional
ApiErrorDetail | null
cause optional
unknown
inputValidation optional
InputValidationDetail | null
providerCode optional

Unrecognized Fluxer error code, as in OperationErrorOptions

string | null
reason
| "input" | "network" | "timeout" | "rejected" | "busy" | "response"
| "rateLimit"| "input" | "network" | "timeout"
| "rejected" | "busy" | "response"
| "rateLimit"
responseField optional

Failed response field or check, as in OperationErrorOptions

string | null
retryAfterMs optional
number | null
status optional
number | null

Properties#

_tag#

Discriminator for identifying expected message-creation failures

readonly _tag: "MessageError"

apiError#

Reviewed Fluxer rejection detail, or null when no safe classification is available

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

inputValidation#

Safe local validation facts when the SDK can identify a failed input rule, otherwise null

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

outcome#

Whether the message may have been created, using the same vocabulary as other operation errors

The outcome notDispatched means no message creation request was sent, and rejected means Fluxer answered with a rejection. Neither is proof of rollback, and preparatory file uploads may already have occurred. The outcome unknown means the message may already have been created, so another send can duplicate it

readonly outcome: OperationOutcome

reason#

Failure category, described by OperationReason

Busy also covers full local upload capacity, and a send never reports notFound

readonly reason:
    | "input" | "network" | "timeout" | "rejected" | "busy"
    | "response" | "rateLimit"readonly reason:
  | "input" | "network" | "timeout"
  | "rejected" | "busy"
  | "response" | "rateLimit"

retryAfterMs#

Server-required wait in milliseconds when usable, otherwise null

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

status#

HTTP status when received, or null for local failures and missing responses

readonly status: number | null

Inherited#

Inherited from FluxerlyError: code, details, hint, toJSON