pub struct ProcessError {
pub message: String,
pub exit_code: Option<i32>,
pub stderr: Option<String>,
}Expand description
Error from the Claude Code CLI subprocess execution.
Contains the exit code and stderr output for debugging.
Fields§
§message: StringHuman-readable process error message (may include code/stderr summary).
exit_code: Option<i32>The process exit code, if available.
stderr: Option<String>The stderr output from the process, if captured.
Implementations§
Source§impl ProcessError
impl ProcessError
Sourcepub fn new(
message: impl Into<String>,
exit_code: Option<i32>,
stderr: Option<String>,
) -> Self
pub fn new( message: impl Into<String>, exit_code: Option<i32>, stderr: Option<String>, ) -> Self
Creates a new ProcessError with the given message, exit code, and stderr.
§Example
use claude_code::ProcessError;
let err = ProcessError::new("Command failed", Some(1), Some("permission denied".to_string()));
assert!(err.to_string().contains("exit code: 1"));Trait Implementations§
Source§impl Clone for ProcessError
impl Clone for ProcessError
Source§fn clone(&self) -> ProcessError
fn clone(&self) -> ProcessError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProcessError
impl Debug for ProcessError
Source§impl Display for ProcessError
impl Display for ProcessError
Source§impl Error for ProcessError
impl Error for ProcessError
1.30.0 · 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<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 ProcessError
impl RefUnwindSafe for ProcessError
impl Send for ProcessError
impl Sync for ProcessError
impl Unpin for ProcessError
impl UnsafeUnpin for ProcessError
impl UnwindSafe for ProcessError
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