pub enum CapabilityError {
InvalidArgs(String),
PermissionDenied(String),
NotFound(String),
Io(Error),
Git(String),
Internal(String),
}Expand description
Error type for capability execution failures.
§Variants
InvalidArgs: Deserialization or validation failed. Message describes the specific field error from serde or manual validation.PermissionDenied: Path or operation rejected by security policy (e.g., path traversal outside allowed prefix).NotFound: Target file or resource does not exist at the specified path.Io: Underlying I/O operation failed (read, write, create, delete).Git: Git command returned an error or produced invalid output.Internal: Unexpected internal failure that should not occur in normal operation. Indicates a bug in the capability implementation.
§Invariants
- Every error carries a human-readable message suitable for logging.
- Callers can match on variant to decide retry/abort/skip behavior.
Iowrapsstd::io::ErrorviaFromfor ergonomic?propagation.
§Errors
This enum IS the error type — no separate error channel exists.
Capabilities return Result<Output, CapabilityError>.
Variants§
InvalidArgs(String)
Deserialization or field validation failed.
Contains a description of the specific validation failure
(e.g., “missing field file_path”, “invalid type: string, expected PathBuf”).
PermissionDenied(String)
Path or operation rejected by security policy.
Triggered when a path traversal check fails or an operation targets a location outside allowed prefixes.
NotFound(String)
Target file or resource does not exist.
The message identifies the missing resource (typically its path).
Io(Error)
Underlying I/O operation failed.
Wraps std::io::Error for ergonomic ? propagation from
filesystem operations (read, write, create, rename, delete).
Git(String)
Git command returned an error or produced invalid output.
Contains the git error message or stderr output.
Internal(String)
Unexpected internal failure.
Should not occur in normal operation. Indicates a bug in the capability implementation or an invariant violation.
Trait Implementations§
Source§impl Debug for CapabilityError
impl Debug for CapabilityError
Source§impl Display for CapabilityError
impl Display for CapabilityError
Source§impl Error for CapabilityError
impl Error for CapabilityError
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()