Errors

Errors

The errors a project throws or catches, imported from curb.

ErrorThrown when
ToolInputErrorA handler refuses its input, with a message for the model
isToolInputErrorTests for that error
AgentAuthoringErrorThe agent is authored wrongly, with a code and a fix
MessageRefusedErrorA message was refused by the app or the host
HostUnavailableErroraskHost found no host connected
HostTimeoutErroraskHost got no answer in time
SettingsRefusedErrorA settings update is not allowed or not valid

ToolInputError

class ToolInputError extends Error {
  constructor(message: string, options?: { data?: unknown });
}

The model reads the message and can ask the caller again.

import { ToolInputError } from "curb";

throw new ToolInputError("That policy number has eight digits.");

Version history

VersionChanges
v1.2.6MessageRefusedError and SettingsRefusedError introduced
v1.1.0HostUnavailableError and HostTimeoutError introduced
v0.1.2ToolInputError, isToolInputError and AgentAuthoringError introduced