pub enum Error {
ClaudeSDK(ClaudeSDKError),
CLIConnection(CLIConnectionError),
CLINotFound(CLINotFoundError),
Process(ProcessError),
CLIJSONDecode(CLIJSONDecodeError),
MessageParse(MessageParseError),
Io(Error),
Json(Error),
Other(String),
}Expand description
Unified error type for all SDK operations.
This enum wraps all specific error types into a single type, enabling
use of the ? operator throughout the SDK.
Variants§
ClaudeSDK(ClaudeSDKError)
General SDK error.
CLIConnection(CLIConnectionError)
Connection error with the CLI process.
CLINotFound(CLINotFoundError)
CLI executable not found.
Process(ProcessError)
CLI process execution error.
CLIJSONDecode(CLIJSONDecodeError)
JSON decoding error from CLI output.
MessageParse(MessageParseError)
Message parsing error.
Io(Error)
Standard I/O error.
Json(Error)
JSON serialization/deserialization error.
Other(String)
Other errors not covered by specific variants.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<CLIConnectionError> for Error
impl From<CLIConnectionError> for Error
Source§fn from(source: CLIConnectionError) -> Self
fn from(source: CLIConnectionError) -> Self
Converts to this type from the input type.
Source§impl From<CLIJSONDecodeError> for Error
impl From<CLIJSONDecodeError> for Error
Source§fn from(source: CLIJSONDecodeError) -> Self
fn from(source: CLIJSONDecodeError) -> Self
Converts to this type from the input type.
Source§impl From<CLINotFoundError> for Error
impl From<CLINotFoundError> for Error
Source§fn from(source: CLINotFoundError) -> Self
fn from(source: CLINotFoundError) -> Self
Converts to this type from the input type.
Source§impl From<ClaudeSDKError> for Error
impl From<ClaudeSDKError> for Error
Source§fn from(source: ClaudeSDKError) -> Self
fn from(source: ClaudeSDKError) -> Self
Converts to this type from the input type.
Source§impl From<MessageParseError> for Error
impl From<MessageParseError> for Error
Source§fn from(source: MessageParseError) -> Self
fn from(source: MessageParseError) -> Self
Converts to this type from the input type.
Source§impl From<ProcessError> for Error
impl From<ProcessError> for Error
Source§fn from(source: ProcessError) -> Self
fn from(source: ProcessError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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
Mutably borrows from an owned value. Read more