pub enum AgentError {
Show 24 variants
SessionNotFound(String),
SessionAlreadyExists(String),
SessionClosed(String),
NotConnected,
ConnectionFailed(String),
ConnectionTimeout(u64),
AlreadyConnected,
AuthRequired,
InvalidApiKey,
InvalidMode(String),
EmptyPrompt,
PromptTooLong {
length: usize,
max: usize,
},
StreamingError(String),
NotificationFailed(String),
ToolExecutionFailed(String),
ToolNotFound(String),
ToolPermissionDenied(String),
ConfigError(String),
MissingConfig(String),
ClaudeSdk(ClaudeError),
Io(Error),
Json(Error),
Internal(String),
Cancelled,
}Expand description
Main error type for the ACP Agent
Variants§
SessionNotFound(String)
Session not found
SessionAlreadyExists(String)
Session already exists
SessionClosed(String)
Session is closed
NotConnected
Client not connected
ConnectionFailed(String)
Connection failed
ConnectionTimeout(u64)
Connection timeout
AlreadyConnected
Already connected
AuthRequired
Authentication required
InvalidApiKey
Invalid API key
InvalidMode(String)
Invalid mode
EmptyPrompt
Empty prompt
PromptTooLong
Prompt too long
StreamingError(String)
Streaming error
NotificationFailed(String)
Notification send failed
ToolExecutionFailed(String)
Tool execution failed
ToolNotFound(String)
Tool not found
ToolPermissionDenied(String)
Tool permission denied
ConfigError(String)
Configuration error
MissingConfig(String)
Missing required configuration
ClaudeSdk(ClaudeError)
Claude SDK error
Io(Error)
IO error
Json(Error)
JSON error
Internal(String)
Internal error
Cancelled
Cancelled
Implementations§
Source§impl AgentError
impl AgentError
Sourcepub fn error_code(&self) -> ErrorCode
pub fn error_code(&self) -> ErrorCode
Get the ACP error code for this error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Check if this error is a client error (caused by invalid input)
Sourcepub fn session_not_found(session_id: impl Into<String>) -> Self
pub fn session_not_found(session_id: impl Into<String>) -> Self
Create a session not found error
Sourcepub fn session_already_exists(session_id: impl Into<String>) -> Self
pub fn session_already_exists(session_id: impl Into<String>) -> Self
Create a session already exists error
Sourcepub fn invalid_mode(mode: impl Into<String>) -> Self
pub fn invalid_mode(mode: impl Into<String>) -> Self
Create an invalid mode error
Sourcepub fn tool_failed(msg: impl Into<String>) -> Self
pub fn tool_failed(msg: impl Into<String>) -> Self
Create a tool execution failed error
Sourcepub fn connection_failed(msg: impl Into<String>) -> Self
pub fn connection_failed(msg: impl Into<String>) -> Self
Create a connection failed error
Sourcepub fn streaming_error(msg: impl Into<String>) -> Self
pub fn streaming_error(msg: impl Into<String>) -> Self
Create a streaming error
Sourcepub fn notification_failed(msg: impl Into<String>) -> Self
pub fn notification_failed(msg: impl Into<String>) -> Self
Create a notification failed error
Sourcepub fn config_error(msg: impl Into<String>) -> Self
pub fn config_error(msg: impl Into<String>) -> Self
Create a configuration error
Sourcepub fn missing_config(key: impl Into<String>) -> Self
pub fn missing_config(key: impl Into<String>) -> Self
Create a missing config error
Trait Implementations§
Source§impl Debug for AgentError
impl Debug for AgentError
Source§impl Display for AgentError
impl Display for AgentError
Source§impl Error for AgentError
impl Error for AgentError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl ErrorTraceExt for AgentError
impl ErrorTraceExt for AgentError
Source§fn trace_error(&self) -> &Self
fn trace_error(&self) -> &Self
Source§impl From<ClaudeError> for AgentError
impl From<ClaudeError> for AgentError
Source§fn from(source: ClaudeError) -> Self
fn from(source: ClaudeError) -> Self
Source§impl From<Error> for AgentError
impl From<Error> for AgentError
Auto Trait Implementations§
impl Freeze for AgentError
impl !RefUnwindSafe for AgentError
impl Send for AgentError
impl Sync for AgentError
impl Unpin for AgentError
impl !UnwindSafe for AgentError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.