Skip to navigation

TypeScript Logging and Errors

Reference for @band-ai/sdk 1.0.0.

Logging

LoggerImportOutput
NoopLogger@band-ai/sdk/coreNothing; the default
ConsoleLogger@band-ai/sdk/coreconsole.debug, console.info, console.warn; errors to stderr
StderrLogger@band-ai/sdk/coreEvery level to stderr, for processes whose stdout carries a protocol

A Logger is any object with debug, info, warn and error methods of type (message: string, context?: Record<string, unknown>) => void.


Errors

Exported from @band-ai/sdk/core. All extend BandSdkError.

ErrorRaised when
ValidationErrorConfiguration is missing or invalid, including the config loaders’ errors
RuntimeStateErrorA lifecycle call is illegal in the current state, such as start() while stop() runs
UnsupportedFeatureErrorAn adapter’s optional peer package is missing, a tool is called whose capability is turned off, or the REST client does not provide an operation
TransportErrorA transport operation fails
RecoverableTurnErrorA failure confined to one turn: that message is marked failed, and the room and every other room keep running. Any other error from an adapter stops the runtime

Platform HTTP errors, such as UnauthorizedError for a 401, come from the generated REST client and carry the status code and response body.