On This Page

MessageCleanupError

Class in Errors · JavaScript & TypeScript

A cleanup preview or deletion failed, with selected IDs and batch progress where available

Preview never deletes. Cleanup can fail after earlier batches received successful responses. The submittedBatches field describes only those earlier responses. The terminalBatchIds field identifies the failed or uncertain request when reached. Its message and details contain no message bodies or criteria, and it proves neither individual deletion nor safe replay. A filter that threw keeps its thrown value as cause, and a failed history read or batch request keeps its operation error as cause. Cancellation in the default API is returned separately as CancelledError. Native interruption and unexpected defects remain outside this error

class MessageCleanupError extends FluxerlyErrorclass MessageCleanupError
  extends FluxerlyError

Constructor#

Record an expected preview or cleanup failure and the submission knowledge available at that point

Optional validation and Fluxer details default to null. Construction performs no requests, deletion or recovery

new MessageCleanupError(
    options: {
        readonly apiError?: ApiErrorDetail | null
        readonly cause?: unknown
        readonly inputValidation?: InputValidationDetail | null
        readonly outcome: MessageCleanupOutcome
        readonly phase: "cleanup" | "preview"
        readonly providerCode?: string | null
        readonly reason: MessageCleanupErrorReason
        readonly responseField?: string | null
        readonly retryAfterMs: number | null
        readonly scannedCount: number
        readonly selectedMessageIds: readonly string[]
        readonly status: number | null
        readonly submittedBatches: readonly MessageCleanupBatch[]
        readonly terminalBatchIds: readonly string[] | null
    }
): MessageCleanupErrornew MessageCleanupError(
  options: {
    readonly apiError?:
      | ApiErrorDetail | null
    readonly cause?: unknown
    readonly inputValidation?:
      | InputValidationDetail
      | null
    readonly outcome:
      MessageCleanupOutcome
    readonly phase:
      | "cleanup" | "preview"
    readonly providerCode?:
      | string | null
    readonly reason:
      MessageCleanupErrorReason
    readonly responseField?:
      | string | null
    readonly retryAfterMs:
      | number | null
    readonly scannedCount: number
    readonly selectedMessageIds:
      readonly string[]
    readonly status: number | null
    readonly submittedBatches: readonly MessageCleanupBatch[]
    readonly terminalBatchIds:
      | readonly string[]
      | null
  }
): MessageCleanupError

Parameters

options
apiError optional
ApiErrorDetail | null
cause optional
unknown
inputValidation optional
InputValidationDetail | null
phase
"cleanup" | "preview"
providerCode optional

Fluxer error code that this SDK version does not recognize, recorded as details.providerCode and named in the message

Ignored when apiError is present or the code does not have the shape of a Fluxer code

string | null
responseField optional

Response field path or named check that failed, recorded as details.responseField for reason response

string | null
retryAfterMs
number | null
scannedCount
number
selectedMessageIds
readonly string[]
status
number | null
submittedBatches
readonly MessageCleanupBatch[]
terminalBatchIds
readonly string[] | null

Properties#

_tag#

Literal error tag for identifying MessageCleanupError

readonly _tag: "MessageCleanupError"

apiError#

Safe Fluxer rejection detail for the failed stage, or null when unavailable

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

inputValidation#

Safe local validation detail, copied and frozen, or null for other failures

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

outcome#

What is known about dispatch at the failed stage, not about the earlier successful batches

readonly outcome: MessageCleanupOutcome

phase#

Which stage failed

The preview phase never deletes, while cleanup can fail after earlier batch submissions

readonly phase: "cleanup" | "preview"readonly phase:
  | "cleanup" | "preview"

reason#

Expected failure classification

The failed message operation or thrown filter value is available through cause

readonly reason: MessageCleanupErrorReason

retryAfterMs#

Fluxer's retry delay in milliseconds, or null

This delay does not establish that a repeat request is safe

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

scannedCount#

Messages inspected before preview failed, or the completed preview's scan count when cleanup failed

readonly scannedCount: number

selectedMessageIds#

Selected message IDs known at failure time, without message bodies or filter details

readonly selectedMessageIds: readonly string[]

status#

HTTP status at the failed stage, or null when unavailable

readonly status: number | null

submittedBatches#

Earlier batch requests with successful HTTP responses, not confirmed individual deletions

readonly submittedBatches: readonly MessageCleanupBatch[]

terminalBatchIds#

Failed or uncertain batch's IDs when a batch request was reached, otherwise null

readonly terminalBatchIds: readonly string[] | nullreadonly terminalBatchIds:
  | readonly string[]
  | null

Inherited#

Inherited from FluxerlyError: code, details, hint, toJSON