Prometheus Entity Management API
    Preparing search index...

    Typed errors used throughout 2.0 to drive retry policy and consumer UI decisions.

    Why two classes (not a discriminator field):

    • instanceof checks are zero-cost at runtime and survive bundler minification of property names.
    • Consumers can write if (error instanceof TerminalError) renderInline() without importing a type-narrowing helper.
    • The engine's retry policy is one instanceof TransientError check.

    4xx → TerminalError (no retry — the request is structurally wrong: unauthorized, not-found, schema mismatch, validation failure).

    5xx + network failures → TransientError (engine retries with exponential backoff up to maxRetries).

    Custom transports can throw either class. The default REST helper (makeRestTransport) maps HTTP status codes to the appropriate class automatically.

    Both classes preserve the original error via the standard cause option so stack traces survive the boundary.

    interface EntityErrorOptions {
        cause?: unknown;
        status?: number;
    }
    Index
    cause?: unknown

    Original thrown value (Error, Response, anything).

    status?: number

    HTTP status if the underlying transport was HTTP.