#[non_exhaustive]pub enum ClaudeError {
CliNotFound,
NonZeroExit {
code: i32,
stderr: String,
},
ParseError(Error),
Timeout,
Io(Error),
StructuredOutputError {
raw_result: String,
source: Error,
},
}Expand description
Error types for claude-code.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
CliNotFound
claude command not found in PATH.
NonZeroExit
CLI exited with a non-zero status code.
ParseError(Error)
Failed to deserialize JSON / stream-json response.
Timeout
Request timed out.
Io(Error)
I/O error from process spawn, stdout/stderr reads, etc.
StructuredOutputError
CLI succeeded but the result field could not be deserialized
into the target type.
Trait Implementations§
Source§impl Debug for ClaudeError
impl Debug for ClaudeError
Source§impl Display for ClaudeError
impl Display for ClaudeError
Source§impl Error for ClaudeError
impl Error for ClaudeError
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<Error> for ClaudeError
impl From<Error> for ClaudeError
Auto Trait Implementations§
impl Freeze for ClaudeError
impl !RefUnwindSafe for ClaudeError
impl Send for ClaudeError
impl Sync for ClaudeError
impl Unpin for ClaudeError
impl UnsafeUnpin for ClaudeError
impl !UnwindSafe for ClaudeError
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