#[non_exhaustive]pub enum Error {
NotImplemented {
operation: &'static str,
},
GateFailed {
reason: String,
},
Invalid {
reason: String,
},
SyncConflict {
reason: String,
},
ChecksFailed {
reason: String,
},
ChecksUnsettled {
reason: String,
},
PushRejected {
reason: String,
},
HostPrerequisite {
reason: String,
},
PushedUnverified {
reason: String,
},
PoolExhausted {
reason: String,
},
UnresolvableReference {
reference: String,
reason: String,
},
}Expand description
Everything an onevcs operation can fail with.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotImplemented
The request parsed and validated, but the seam behind it has no implementation yet. The CLI reports this as exit code 70.
GateFailed
A publication was refused by something that judged it, where no narrower
kind says which. Today that is the repository’s own commit-msg hook turning
down the subject the publication would land under, and a host that took a
merge and then reported it unperformed. The CLI reports this as exit code 1.
What the host’s checks reported is Error::ChecksFailed or
Error::ChecksUnsettled, and what its pre-push hook said is
Error::PushRejected.
Named for the tier this crate used to run itself and kept under that name: the contract fixes this vocabulary across the three libraries that route on it, so a variant is not renamed because the tier behind it went away.
Invalid
Input was rejected at a trust boundary — a malformed registry document, a rules file that does not parse, an unusable argument. The CLI reports this as exit code 2.
SyncConflict
The base moved under a publication and the bounded resolve-and-requeue did not converge. The CLI reports this as exit code 3.
ChecksFailed
A required check the host reports concluded red. The CLI reports this as exit code 1, which is the code the contract fixes for a verification failure — this says which verification failed, not a different one.
ChecksUnsettled
The bound on watching the host elapsed with the change still outstanding. The CLI reports this as exit code 1.
Named for the commonest way that happens and shared with the others,
because the failure vocabulary is fixed across the three libraries that
route on it. Distinct from Error::ChecksFailed because the operator’s
next move differs: nothing has failed, and the publication stopped watching.
Fields
PushRejected
The publishing push was refused by the merge path. The CLI reports this as exit code 1.
HostPrerequisite
The publishing push was refused by the merge path because this host is missing a tool or a credential one of its hooks needs — a failure that does not depend on the tree being pushed. The CLI reports this as exit code 1.
Said by the hook itself, on the one line
HOST_PREREQUISITE_MARKER begins, and never
inferred: a refused push carrying no such line is Error::PushRejected. A
kind of its own for the reason Error::PushedUnverified is one: a router
branches on the kind, and no change to the work can clear this refusal.
Fields
PushedUnverified
The publishing push reached the remote, and the merge path could not then be read. The CLI reports this as exit code 1.
A kind of its own rather than a reason clause on the three above, because a
router branches on the kind: a sentence added to Error::ChecksFailed
still routes as “the checks said no”. Widening a vocabulary fixed across the
libraries that route on it is the amendment in docs/contract.md, which
records why.
PoolExhausted
A session could not be placed: every slot of the identity’s pool is held and
its overflow admits no more. onevcs session open reports this as exit code 4,
and nothing waits — a caller decides whether to queue, close something, or open
with --overflow unlimited.
Never a publication failure, so FailureKind — the
vocabulary fixed across the three libraries that route a publication’s outcome
— has no kind for it and reports it as Invalid should one ever reach there.
Fields
UnresolvableReference
A reference named no work this host knows — it is not a change request
onevcs opened, a session token it printed, a branch any checkout or run
clone of a registered identity holds, or a commit one of those branches
carries. The CLI reports this as exit code 2.
A kind of its own for the reason Error::PushedUnverified is one: a caller
branches on the kind. A consumer that falls back from one spelling of a
reference to another — onepipeline’s release asker, from a squash commit to
the change request it settled — has to fire on exactly this case and never on
an I/O failure or a host that refused, and telling them apart by matching the
reason’s prose breaks silently the day the wording changes.
It says nothing new to whoever reads the refusal, so it renders and exits
exactly as Error::Invalid does, down to the invalid input: prefix: the
typed answer is for the router, and a rewording of the CLI’s output would be
the breaking change this exists to prevent. FailureKind
— the vocabulary fixed across the three libraries that route a publication’s
outcome — gains no kind for it and reports it as Invalid, which is what fixes
the exit code at 2.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()