#[non_exhaustive]pub enum Error {
Show 21 variants
NotRepository(PathBuf),
NotFound(String),
InvalidId(String),
InvalidInput(String),
IdempotencyConflict,
IdempotencyNotFound,
InvalidState {
id: String,
state: String,
expected: String,
},
UnsafeState(String),
ForeignWorktree(PathBuf),
UnsealedChanges(String),
ResultDrift(String),
DirtyIntegrationTarget(PathBuf),
Git {
command: String,
status: i32,
stderr: String,
},
GitOutputTooLarge {
command: String,
cap: usize,
},
NonUtf8Path(PathBuf),
SchemaVersion {
found: u32,
supported: u32,
},
ArtifactNotFound(String),
Verification(String),
Io {
path: PathBuf,
source: Error,
},
Json {
path: PathBuf,
source: Error,
},
CaptureWorker,
}Expand description
Everything that can go wrong in a capsule operation.
Variants are deliberately specific so callers can branch on failure without
parsing messages. The capsule binary maps each variant to a stable kind
string in its JSON error output.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotRepository(PathBuf)
The given path is not inside a Git repository.
NotFound(String)
No capsule with this identifier exists.
InvalidId(String)
The identifier is not a well-formed capsule ID.
InvalidInput(String)
Caller input was missing, malformed, or out of bounds.
IdempotencyConflict
An existing key is permanently bound to a materially different creation request.
IdempotencyNotFound
No reservation exists for the requested state-root-scoped idempotency key.
InvalidState
The operation is not allowed from the capsule’s current state.
Fields
UnsafeState(String)
Stored state is inconsistent, unsafely shaped, or self-contradictory.
ForeignWorktree(PathBuf)
A path no longer proves it is the worktree the capsule created.
Returned instead of deleting anything, even under --force.
UnsealedChanges(String)
Cleanup was requested for a capsule whose work is not sealed.
ResultDrift(String)
Tracked content or result artifacts changed after the result was sealed.
DirtyIntegrationTarget(PathBuf)
The integration target has uncommitted changes.
Git
A Git subprocess exited unsuccessfully.
Fields
GitOutputTooLarge
A Git subprocess produced more output than its in-memory bound allows.
Fields
NonUtf8Path(PathBuf)
A path cannot be represented in the UTF-8 result inventory.
SchemaVersion
Stored state was written by an incompatible schema version.
ArtifactNotFound(String)
The requested artifact is not part of this capsule’s sealed result.
Verification(String)
An exported receipt failed verification.
Io
A filesystem operation failed.
Json
Stored or supplied JSON could not be decoded or encoded.
CaptureWorker
An internal thread draining Git output 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()