pub enum Error {
NotFound,
CommandFailed {
command: String,
exit_code: i32,
stdout: String,
stderr: String,
working_dir: Option<PathBuf>,
},
Io {
message: String,
source: Error,
working_dir: Option<PathBuf>,
},
Timeout {
timeout_seconds: u64,
},
Json {
message: String,
source: Error,
},
VersionMismatch {
found: CliVersion,
minimum: CliVersion,
},
DangerousNotAllowed {
env_var: &'static str,
},
BudgetExceeded {
total_usd: f64,
max_usd: f64,
},
DuplexClosed,
DuplexTurnInFlight,
DuplexControlFailed {
message: String,
},
}Expand description
Errors returned by claude-wrapper operations.
Variants§
NotFound
The claude binary was not found in PATH.
CommandFailed
A claude command failed with a non-zero exit code.
Io
An I/O error occurred while spawning or communicating with the process.
Timeout
The command timed out.
Json
JSON parsing failed.
VersionMismatch
The installed CLI version does not meet the minimum requirement.
DangerousNotAllowed
Construction of a dangerous::Client was attempted without
the opt-in env-var set. The env-var name is a compile-time
constant exported from crate::dangerous::ALLOW_ENV.
BudgetExceeded
A configured BudgetTracker has
hit its max_usd ceiling. Raised before the next call is
dispatched, so the CLI is not invoked.
DuplexClosed
A DuplexSession operation was
attempted after the session task exited (child died, EOF on
stdout, or the session was closed). Pending replies are
resolved with this error.
DuplexTurnInFlight
DuplexSession::send was
called while another turn is already in flight. Wait for the
outstanding turn to resolve before issuing another.
DuplexControlFailed
A control request issued from
DuplexSession::interrupt
(or any other outbound control_request) was answered by the
CLI with a subtype: "error" payload.
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()