error
Error types for the Agent SDK
This module provides unified error handling for the SDK, wrapping underlying A2A protocol errors and adding SDK-specific error types.
Type Aliases
Section titled “Type Aliases”SdkResult
Section titled “SdkResult”type SdkResult = Result<T, SdkError>;Result type for SDK operations
SdkError
Section titled “SdkError”SDK-specific error types
Wraps underlying A2A protocol errors and adds SDK-specific error cases for better error handling and user experience.
Variants
| Variant | Description |
|---|---|
A2AProtocol(error::A2AError) | A2A protocol error |
Configuration { ... } | Configuration error |
AgentInitialization { ... } | Agent initialization error |
SkillRegistration { ... } | Skill registration error |
MethodExecution { ... } | Method execution error |
Serialization(serde_json::Error) | Serialization error |
Io(Error) | IO error |
Generic(anyhow::Error) | Generic error |
FeatureNotEnabled { ... } | Feature not enabled |
InvalidInput { ... } | Invalid input |
Methods
configuration
Section titled “configuration”fn configuration<impl Into<String>>(details: impl Into) -> SelfCreate a configuration error
agent_initialization
Section titled “agent_initialization”fn agent_initialization<impl Into<String>>(reason: impl Into) -> SelfCreate an agent initialization error
skill_registration
Section titled “skill_registration”fn skill_registration<impl Into<String>, impl Into<String>>(skill: impl Into, reason: impl Into) -> SelfCreate a skill registration error
method_execution
Section titled “method_execution”fn method_execution<impl Into<String>, impl Into<String>>(method: impl Into, details: impl Into) -> SelfCreate a method execution error
feature_not_enabled
Section titled “feature_not_enabled”fn feature_not_enabled<impl Into<String>>(feature: impl Into) -> SelfCreate a feature not enabled error
invalid_input
Section titled “invalid_input”fn invalid_input<impl Into<String>>(details: impl Into) -> SelfCreate an invalid input error
is_recoverable
Section titled “is_recoverable”fn is_recoverable(&self) -> boolCheck if error is recoverable
category
Section titled “category”fn category(&self) -> &''static strGet error category for monitoring/logging