class CloudflareBindingMissingError
extends Error
Since 0.2.0

A binding the configuration names is absent from the Worker's env, or is present with the wrong shape.

A missing binding is a deployment error — a stanza absent from wrangler.toml, a name typo, a preview environment that was never given the namespace. Throwing with the requested name and the names that are present turns a downstream undefined is not a function into a message that says what to fix.

Constructors

CloudflareBindingMissingError(message: string)
Parameters
message: string

What was requested, and what is available instead

Static Methods

absent(
binding: string,
available: readonly string[]
): CloudflareBindingMissingError

Builds the error for a binding that is absent entirely.

wrongShape(
binding: string,
expected: string
): CloudflareBindingMissingError

Builds the error for a binding that is present with the wrong shape.

Properties

readonly
name: string

Discriminating name for instanceof-free checks.

Usage

import { CloudflareBindingMissingError } from "cloudflare-plugin/src/index.ts";