pub enum Error {
BinaryNotFound,
Spawn(Error),
Timeout,
Parse(Error),
Cli {
status: Option<i32>,
stderr: String,
},
Api {
status: Option<u16>,
message: String,
},
Isolation(Error),
}Expand description
Errors that can occur while building, spawning, or parsing output from the
claude CLI subprocess.
Variants§
BinaryNotFound
The claude binary could not be located (via CLAUDE_BINARY or PATH).
Spawn(Error)
Spawning or communicating with the child process failed.
Timeout
The call exceeded its configured timeout.
Parse(Error)
The CLI’s JSON output could not be parsed into the expected shape.
Cli
The claude CLI itself failed before producing a response envelope —
bad arguments, a missing prompt, a crash. Diagnosed by an empty stdout;
the message is on stderr.
Distinct from Error::Api: here the CLI never reached the API.
Fields
Api
The CLI ran and emitted a well-formed envelope reporting a failure
(is_error: true) — e.g. an unroutable model, or an API outage.
Distinct from Error::Cli: the CLI worked; the API call did not.
Note the message arrives on stdout, inside the JSON’s result field —
stderr is empty on this path.
Fields
Isolation(Error)
Setting up an isolated CLAUDE_CONFIG_DIR (temp dir creation, or a
credentials/.claude.json source that exists but could not be read
or copied) failed.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more