Skip to main content

Error

Enum Error 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NotImplemented

The request parsed and validated, but the seam behind it has no implementation yet. The CLI reports this as exit code 70.

Fields

§operation: &'static str

The contract operation that was asked for, e.g. Vcs::open_session.

§

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.

Fields

§reason: String

What failed, and what turned it down.

§

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.

Fields

§reason: String

What was rejected and why.

§

SyncConflict

The base moved under a publication and the bounded resolve-and-requeue did not converge. The CLI reports this as exit code 3.

Fields

§reason: String

The conflict that survived the bounded retry.

§

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.

Fields

§reason: String

The check that concluded red, named, and a bounded excerpt of its log.

§

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

§reason: String

What was still outstanding when the bound elapsed: the required checks that had not settled, that the host declared none at all, or — where every one of them had settled — that it never performed the merge.

§

PushRejected

The publishing push was refused by the merge path. The CLI reports this as exit code 1.

Fields

§reason: String

git’s own per-ref refusal, which is what an operator acts on.

§

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

§reason: String

What the hook said is missing and how to install it, and where the whole of what the merge path wrote is kept.

§

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.

Fields

§reason: String

Where the push landed, and what stopped the merge path being read.

§

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

§reason: String

The identity, its pool and overflow with where each limit came from, and every holder: token, branch, worktree, owner pid and liveness.

§

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.

Fields

§reference: String

The reference as it was asked about, so a caller that routes on this kind names what it could not resolve without parsing the reason.

§reason: String

What the reference was searched for as, and where the spellings that do answer are listed.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.