Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 33 variants Unsupported { operation: &'static str, }, RepoNotFound(PathBuf), DirtyWorkingTree { operation: &'static str, }, Conflict { operation: &'static str, }, PushRejected(PushRejection), RemoteGroupPending { branch: String, run_id: String, }, NotFastForward, RewordRefused(RewordRefusal), SplitRefused(SplitRefusal), RewriteRefused(RewriteRefusal, String), ApplyRefused(ApplyRefusal), RebaseRefused(RebaseRefusal), ConflictRefused(ConflictRefusal), UndoRefused(UndoRefusal), NeedsConfirmation(String), LfsUnavailable { reason: LfsUnavailableReason, }, LfsLockingUnsupported { remote: String, }, NeedsAutoStash { operation: String, }, PendingAutoStash { operation: String, stash: StashId, hint: String, }, NotBuilt { feature: &'static str, }, RepoAuthUnavailable { reason: String, }, TokenCommandFailed { exit: Option<i32>, stderr_tail: String, }, RepoAuthCommandChanged { path: String, }, GrantRefused { host: String, expected: String, }, CredentialHelperUnreachable, Canceled { job: u64, }, NotCancellable { reason: NotCancellableReason, }, JobConflict { existing: u64, }, HooksNotTrusted { hash: String, hooks: Vec<HookInfo>, }, SensitiveStage { files: Vec<Sensitive>, }, Backend(String), Git { message: String, detail: Box<ErrorDetail>, }, Io(Error),
}

Variants§

§

Unsupported

Fields

§operation: &'static str
§

RepoNotFound(PathBuf)

§

DirtyWorkingTree

Fields

§operation: &'static str
§

Conflict

Fields

§operation: &'static str
§

PushRejected(PushRejection)

The remote refused a push in a way the user can act on: it has commits we do not (NonFastForward), or a lease found it moved (StaleLease). A variant rather than a Backend string because the TUI answers it with a dialog (pull first / force with lease / cancel), and a dialog keyed on git’s English stderr would break on the first localised git.

§

RemoteGroupPending

A grouped push or pull of branch is saved (stopped on conflicts, canceled or with targets to retry): continue, retry or abort it (resume) instead of starting another. Nothing was changed.

Fields

§branch: String
§run_id: String
§

NotFastForward

A fast-forward-only pull found the branch and its upstream diverged, or GitBackend::fast_forward found the branch and its target diverged. Nothing was changed.

§

RewordRefused(RewordRefusal)

reword refused before changing anything (see RewordRefusal). Typed because the TUI words each case differently and the CLI reports it as a stable code.

§

SplitRefused(SplitRefusal)

split_commit refused before changing anything (see SplitRefusal).

§

RewriteRefused(RewriteRefusal, String)

A history rewrite refused before changing anything (see RewriteRefusal); the string says which rule, path or ref.

§

ApplyRefused(ApplyRefusal)

apply_commit_to_worktree refused before changing anything (see ApplyRefusal).

§

RebaseRefused(RebaseRefusal)

An interactive rebase (or continue/skip/abort) refused before changing anything (see RebaseRefusal).

§

ConflictRefused(ConflictRefusal)

A conflict call (resolve_conflict, unresolve_conflict, operation_abort) refused before changing anything (see ConflictRefusal).

§

UndoRefused(UndoRefusal)

An undo or redo (or a compare-and-swap ref update) refused before changing anything (see UndoRefusal).

§

NeedsConfirmation(String)

An undo or redo that is risky (it would overwrite working-tree files, or the undone commit is already on its upstream) and was not sent with confirmed. Nothing was changed; the prompt names what is at stake.

§

LfsUnavailable

An LFS operation needs the git-lfs program and it is missing (or too old). Typed so every frontend can show the install link instead of git’s raw “‘lfs’ is not a git command”.

§

LfsLockingUnsupported

The LFS remote does not implement the locking API.

Fields

§remote: String
§

NeedsAutoStash

operation was blocked by local changes, general.auto_stash is ask, and nobody was there to answer. Nothing was changed. A UI answers with its dialog and resends the request with autostash: "always"; a CLI/MCP caller reads the message and passes --autostash. Typed so the TUI never matches on git’s English stderr.

Fields

§operation: String
§

PendingAutoStash

The repository has a pending auto-stash (stash is its index in the stash list) and operation would bury or tangle it. Nothing was changed. hint says how to resolve it. Typed so each frontend can point at its own resolving actions.

Fields

§operation: String
§stash: StashId
§hint: String
§

NotBuilt

The operation belongs to a feature this binary was built without (a custom build, see docs/user/custom-builds.md). feature is the cargo feature name (lfs, worktree, …). Typed so each frontend words it in its own language and the CLI reports a stable code.

Fields

§feature: &'static str
§

RepoAuthUnavailable

The repository’s authentication profile cannot be used (its file is unreadable, the integration it names is gone, a key file is missing, or the source is not available in this version). The transfer is refused: it never falls back to the machine’s own credentials, because pushing to work with a personal account is the failure to avoid.

Fields

§reason: String
§

TokenCommandFailed

The repository’s token command did not give a token: it exited non-zero (exit), timed out or could not start (exit is None), or printed nothing usable. stderr_tail is the end of its standard error, already redacted (it never carries the token). The transfer is refused.

Fields

§exit: Option<i32>
§stderr_tail: String
§

RepoAuthCommandChanged

A file the confirmed credential helper or token command runs, inside the repository’s work tree, is not the one the person confirmed (a pull can change a tracked script). path names it. The transfer is refused until the command is confirmed again.

Fields

§path: String
§

GrantRefused

The transfer was refused credentials because git asked for a host that is not the account’s own address: host is where git went (a remote URL rewritten by the repository’s own url.<x>.insteadOf, say), expected the address the account’s token is bound to. The token was not sent.

Fields

§host: String
§expected: String
§

CredentialHelperUnreachable

git needed a credential from GitPoulpi’s credential helper and got none because the helper never reached the daemon that issued the grant (the daemon was gone or its endpoint could not be read). Nothing was sent to the server.

§

Canceled

A background job was canceled (JobCancel, or a client that asked for cancel-on-disconnect went away). The repository is as it was before the operation, or at its last safe point (see the cancel policy in the background-ops design`). Every caller waiting on the job, the one that started it and the ones that joined it, gets this.

Fields

§job: u64
§

NotCancellable

JobCancel on a job that cannot be stopped safely right now (it is past its point of no return, or it has already ended). Nothing was changed.

§

JobConflict

A second request for a job that must not run twice (a clone into a destination another clone is filling). existing is the job already running.

Fields

§existing: u64
§

HooksNotTrusted

The committed workflow hooks were asked to run but this user has not trusted them as they are now. Nothing ran. hash is what FlowTrustHooks takes, hooks the exact commands.

Fields

§hash: String
§hooks: Vec<HookInfo>
§

SensitiveStage

A stage request would add files that look sensitive (a private key, a .env, a recognised token) and the caller did not allow it. Nothing was staged. files lists each file with its reason, never a value.

Fields

§

Backend(String)

§

Git

A backend failure with its facts attached (the command that ran, its exit code and stderr, or libgit2’s class and code), so a frontend can say what went wrong instead of “the backend failed”. Display is the same text a plain Backend error would have.

Fields

§message: String
§

Io(Error)

Implementations§

Source§

impl Error

Source

pub fn typed(&self) -> Option<TypedError>

The typed part of this error, if it has one.

Source

pub fn detail(&self) -> Option<&ErrorDetail>

The facts of the failure, when the backend recorded them.

Source

pub fn git(message: impl Into<String>, detail: ErrorDetail) -> Self

A backend failure carrying detail.

Source

pub fn from_wire(message: String, detail: Option<ErrorDetail>) -> Self

Error::from_wire_message with the detail that travelled beside the message, when there was one.

Source

pub fn from_wire_message(message: String) -> Self

An error that arrived over the wire as plain text: the daemon sent Error’s own Display, which for a backend failure already starts with backend error: . Wrapping that text in Error::Backend again would print the prefix twice, so it is taken off first.

Source

pub fn from_typed(typed: TypedError) -> Self

The inverse of Error::typed.

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

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

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Forget for Error

§

impl Freeze for Error

§

impl Move for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

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