ValueError
, TypeError
. However, to provide a more comprehensive error handling experience, we have introduced FrameworkError
, which is a subclass of Exception. Where additional context is needed, we can use FrameworkError
to provide additional information about the nature of the error. This may wrap the original exception following the standard Python approach.
Benefits of using FrameworkError
:
FrameworkError
to create specialized error classes for different components or scenarios. This ensures that each part of the framework has clear and well-defined error types, improving debugging and error handling.
FrameworkError
can be done by calling the FrameworkError.ensure
static method (Python example, TypeScript example).Error Class | Category | Description |
---|---|---|
AbortError | Aborts | Raised when an operation has been aborted |
ToolError | Tools | Raised when a problem is reported by a tool |
ToolInputValidationError | Tools | Extends ToolError, raised when input validation fails |
AgentError | Agents | Raised when problems occur in agents |
PromptTemplateError | Prompt Templates | Raised when problems occur processing prompt templates |
LoggerError | Loggers | Raised when errors occur during logging |
SerializerError | Serializers | Raised when problems occur serializing or deserializing objects |
WorkflowError | Workflow | Raised when a workflow encounters an error |
ParserError | Parser | Raised when a parser fails to parse the input data. Includes additional Reason |
ResourceError | Memory | Raised when an error occurs with processing agent memory |
ResourceFatalError | Memory | Extends ResourceError, raised for particularly severe errors that are likely to be fatal |
EmitterError | Emitter | Raised when a problem occurs in the emitter |
BackendError | Backend | Raised when a backend encounters an error |
ChatModelError | Backend | Extends BackendError, raised when a chat model fails to process input data |
MessageError | Backend | Raised when a message processing fails |
FrameworkError
or any of the other errors above:
FrameworkError
, for example:
explain
static method will return a string that may be more useful for an LLM to interpret: