Skip to main content

StikkError

Enum StikkError 

Source
#[non_exhaustive]
pub enum StikkError { Refusal { message: String, }, LockConflict { message: String, }, NotReady { detail: String, }, IntegrityFinding { message: String, }, Limits { message: String, }, Environment { detail: String, source: Option<Box<dyn Error + Send + Sync + 'static>>, }, Internal { detail: String, }, Stale { operation: String, cause: StaleCause, }, Declined { detail: String, }, CrossRef { message: String, }, }
Expand description

Every error stikk surfaces, tagged with the class that decides how it is presented (design stikk-04 CT-04). The class is the whole point: a refusal opens the explanation overlay, a lock conflict is a banner, a not-ready is inline guidance, and so on — one mapping, both frontends.

#[non_exhaustive]: adding a class later is not a breaking change to downstream matchers.

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.
§

Refusal

prikk semantically refused an operation (a non-confluent merge, a TOFU key conflict, a path/ref validation refusal). message is prikk’s own wording, preserved verbatim.

Fields

§message: String

prikk’s verbatim refusal message. Never rewritten by a layer above.

§

LockConflict

Another writer holds a lock, or a CAS precondition failed. prikk distinguishes a genuine lock from a ref-CAS mismatch; both arrive here and the message carries which.

Presented as prikk’s verbatim message in a banner (present.rs’s LockConflict arm), with no gloss — the absence is deliberate (ER-02). This doc previously said it was presented as FR-106’s “another writer is active”; that was true when written and is not now. RFC 017 F4 found that gloss rendered over six prikk messages that were preconditions, not locks — nothing held, no other writer — and the fix narrowed the classifier so those reach Refusal instead, leaving this class carrying only real conflicts and nothing to add to them. FR-106’s wording is now present()’s alone, keyed on the one message shape it is true of, and this class no longer implies it. That the correction was needed at all is the F1 shape in the error taxonomy’s own documentation, and it is what put a wrong premise into RFC 022’s Q1.

Fields

§message: String

prikk’s verbatim conflict message.

§

NotReady

A signing or trust prerequisite is absent — no AUTHOR/MAINTAINER readiness, or the maintainer key is not adopted. Presented as inline guidance toward the trust/keys surface (FR-104).

Fields

§detail: String

What is missing, in stikk’s own words (this class is stikk-originated, not prikk’s).

§

IntegrityFinding

A verify/doctor finding — repository-content diagnostics. Routed into the verify/doctor views, never a popup (design OP-03). Currently unconstructible: the seam’s own arm that used to build this (is_integrity_finding) had no captured message behind any of its three strings and was removed rather than kept on a guess (RFC 017 F2/§3) — nothing in the workspace constructs this variant today. It stays in the taxonomy because present()’s RoutedIntoView mapping is the right forward shape for FR-100’s still-unbuilt Verify view, and a future classifier arm grounded on real verify/doctor output will need somewhere to route to.

Fields

§message: String

prikk’s verbatim finding text.

§

Limits

An input ceiling was (or would be) exceeded — a bundle/exchange/summary limit. Surfaced in the pre-execution confirmation, not after failure (threat model C-D2a).

Fields

§message: String

prikk’s verbatim limit message.

§

Environment

An environment problem: I/O, permissions, a missing or wrong prikk binary, version skew, or an unparseable prikk output shape. Carries a stikk-authored description plus any underlying cause via std::error::Error::source.

Fields

§detail: String

What went wrong, in stikk’s own words.

§source: Option<Box<dyn Error + Send + Sync + 'static>>

The underlying cause, if any (e.g. a std::io::Error), preserved for source().

§

Internal

A stikk-internal fault (a bug). The repository was not touched — only the seam writes, and only on an explicit confirmed mutation — so a fault here can never be a repository write (design ER-04). Session state is already flushed; the user may continue read-only.

Fields

§detail: String

A description of the internal invariant that was violated.

§

Stale

The repository changed between a preview and its confirmation, or between confirmation and execution (design OPL-02/CT-05; RFC 013 decision 3). prikk did not refuse this — stikk did, on comparing the change token stamped at preview time against a freshly-read one. Never Refusal (that would put stikk’s own words in prikk’s voice) and never LockConflict (nothing is locked). The user’s next action is to look again: present() routes this to a re-preview prompt, and no next-step it offers may re-run the execution (NFR-S04).

Fields

§operation: String

The operation whose preview or confirmation no longer matches the repository’s current state — stikk’s own short name for it (e.g. "commit"), never prikk’s words.

§cause: StaleCause

Which check saw it (RFC 030 amendment A3): the change-token comparison, or commit’s worktree re-read. Only the check that failed knows, and the words a user reads differ, because a worktree change is not a repository change (C-T2b).

§

Declined

The confirmation evidence supplied did not satisfy the tier’s requirement: a missing explicit yes, or a typed name that does not exactly match the confirmation summary’s target (design FR-121; RFC 013 §4). Distinct from StikkError::Stale (nothing about the repository moved) and from StikkError::NotReady (capability and read-only mode were both sufficient — the evidence itself was not). Belongs inside the confirmation surface that asked for the evidence, never a separate popup (Presentation::InConfirmation) — the user is still mid-confirmation, not facing a new failure.

Fields

§detail: String

What was required and what was supplied, in stikk’s own words.

§

CrossRef

A commit refused because the active WAL’s queue targets a different ref than the one requested (design RFC 014 F2/decision 2). Never StikkError::LockConflict, even though prikk words it as one ("lock conflict: active WAL is owned by …; requested ref …") — nothing is locked, no other writer is active, and LockConflict will grow a jump to a lock inspector (FR-102) that would show this condition no lock to find (RFC 012 F-b’s overloaded-class shape, again). stikk prevents this client-side before arming a commit (Orientation::queued_target); this class exists for the race where the queue moves between preview and execute. message is prikk’s own wording, preserved verbatim (ER-02) — the same discipline as StikkError::Refusal.

Fields

§message: String

prikk’s verbatim cross-ref refusal message.

Implementations§

Source§

impl StikkError

Source

pub fn environment( detail: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self

Construct an StikkError::Environment from a description and an underlying cause.

Source

pub fn environment_msg(detail: impl Into<String>) -> Self

Construct an StikkError::Environment with no underlying cause.

Source

pub const fn class(&self) -> &'static str

The stable machine-readable class name, for the report format (design CL-07) and for tests.

Source

pub const fn is_user_resolved(&self) -> bool

True when this class must never be auto-retried (design NFR-S04): a refusal, a lock conflict, a not-ready condition, a stale precondition, declined evidence, or a cross-ref conflict is the user’s to resolve, never stikk’s to retry silently. Stale in particular must never be retried as-is — its whole point is that retrying the same execution is exactly the prohibited thing (RFC 013 decision 3); the user’s only correct next step is a fresh preview.

Trait Implementations§

Source§

impl Debug for StikkError

Source§

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

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

impl Display for StikkError

Source§

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

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

impl Error for StikkError

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

Replaced by Error::source.
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§

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<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> 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.