On This Page

CollectorError

Class in Errors · JavaScript & TypeScript

Expected collector failure, separate from results that stop at the count, deadline, idle deadline or explicit stop

Contains no message bodies or partial observations. A filter or callback failure keeps the application's thrown value as cause. A filter or callback failure is also reported to the client-level onError as a filter or collector FailureReport with the message IDs, or logged at Error without a hook. Other failures except connectionLost are logged at Warn in the collectors category. Unexpected defects, including cleanup defects, are not made into this expected failure

class CollectorError extends FluxerlyErrorclass CollectorError
  extends FluxerlyError

Constructor#

Describe a collector failure, optionally identifying the budget and capacity that were exceeded

Collector errors are normally received from a collector. Construction does not stop a collector

new CollectorError(
    reason:
        | "filter" | "overflow" | "handler" | "notConnected"
        | "connectionLost",
    limit?:
        | "maxBytes" | "maxPendingMessages" | "maxPendingBytes"
        | null,
    capacity?: number | null,
    options?: { readonly cause?: unknown }
): CollectorErrornew CollectorError(
  reason:
    | "filter" | "overflow"
    | "handler" | "notConnected"
    | "connectionLost",
  limit?:
    | "maxBytes"
    | "maxPendingMessages"
    | "maxPendingBytes" | null,
  capacity?: number | null,
  options?: {
    readonly cause?: unknown
  }
): CollectorError

Parameters

reason

The reason notConnected means registration lacked a connected gateway scope, connectionLost means that scope later recovered or disconnected

The reason filter or handler means application selection or callback failed, overflow means a retained or pending budget was exceeded

| "filter" | "overflow" | "handler" | "notConnected"
| "connectionLost"| "filter" | "overflow" | "handler"
| "notConnected" | "connectionLost"
limit optional

Name of the exceeded budget, or null when the failure was not overflow

"maxBytes" | "maxPendingMessages" | "maxPendingBytes" | null| "maxBytes" | "maxPendingMessages"
| "maxPendingBytes" | null
capacity optional

Configured budget capacity, measured in queued payloads or UTF-8 JSON bytes, or null for other failures

number | null
options optional

Optional underlying failure retained as the error's cause

{ readonly cause?: unknown }

Properties#

_tag#

Literal error tag for identifying CollectorError

readonly _tag: "CollectorError"

capacity#

Configured budget capacity, measured in queued payloads or UTF-8 JSON bytes, or null for other failures

readonly capacity: number | null

limit#

Name of the exceeded budget, or null when the failure was not overflow

readonly limit:
    | "maxBytes" | "maxPendingMessages" | "maxPendingBytes" | nullreadonly limit:
  | "maxBytes"
  | "maxPendingMessages"
  | "maxPendingBytes" | null

reason#

The reason notConnected means registration lacked a connected gateway scope, connectionLost means that scope later recovered or disconnected

The reason filter or handler means application selection or callback failed, overflow means a retained or pending budget was exceeded

readonly reason:
    | "filter" | "overflow" | "handler" | "notConnected"
    | "connectionLost"readonly reason:
  | "filter" | "overflow"
  | "handler" | "notConnected"
  | "connectionLost"

Inherited#

Inherited from FluxerlyError: code, details, hint, toJSON