crouter
PluginReference

Errors

Failing a leaf with an exit code, a message and optional remediation.

Exports of @crouter/plugin, read from the TypeScript compiler at build time. Types re-exported from @crouter/api are documented with that package.

LeafError

class declared in errors.ts

Throw this from a handler to report an expected application error. The Fetch handler turns it into the non-2xx error envelope crtr reads; anything else thrown becomes a 500 handler_failed. The constructor throws when code is reserved or malformed, or when status is outside 400–599, and throws PluginDefinitionError for unauthorized, scope_missing, and approval_required, which only the kit's own helpers emit. provider_refused always has status 403.

Prop

Type

LeafErrorOptions

interface declared in errors.ts

What a LeafError reports.

Prop

Type

LeafErrorQuestion

interface declared in errors.ts

What an approval_required error asks the user.

Prop

Type

On this page