Skip to main content

RemoteError

Enum RemoteError 

Source
#[non_exhaustive]
pub enum RemoteError {
Show 37 variants NoUrl { remote: Option<String>, }, UnsupportedScheme, InvalidUrl { detail: String, }, HttpUnavailable, UnknownRemote { name: String, }, RemoteExists { name: String, }, InvalidRemoteName { name: String, }, Auth { url: String, reason: AuthFailure, }, CredentialsUnavailable { helpers: Vec<String>, }, PushAtomicUnsupported, PushOptionsUnsupported, FetchUnshallowNotShallow, FetchShallowUnsupported, FetchDeepenRelativeUnsupported, ReceivedPackTempMissing { path: PathBuf, }, Unreadable { url: Option<String>, reason: RemoteUnreadableReason, }, Fatal { message: String, }, LocalUploadPack(Box<ServeError>), Serve(ServeError), LocalUploadPackPanicked, Resumable(Box<ResumableError>), FetchRefspec(FetchRefspecError), FetchIntoCheckedOutBranch { branch: String, }, Protocol(ProtocolError), PushPlan(PushPlanError), PartialClone(PartialCloneError), MalformedTransportUrl { scheme: &'static str, detail: String, }, Ssh { detail: String, }, Transport { url: Option<String>, detail: String, }, HttpStatus { url: Option<String>, status: u16, }, Http { detail: String, }, HttpWorkerPanicked, HttpLowSpeedStall { detail: String, }, Credential { detail: String, }, Snapshot(CheckoutError), Clone(Box<CloneError>), Bundle(BundleError),
}
Expand description

Errors for remote URL resolution, transport, fetch, push, and clone.

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

NoUrl

A remote has no URL: remote.<name>.url is unset or blank, or a literal URL was empty.

Fields

§remote: Option<String>

The configured remote’s name; None when an empty literal URL was given.

§

UnsupportedScheme

The URL uses a scheme grit does not support for remotes.

§

InvalidUrl

A URL or path failed to parse.

Fields

§detail: String

Why the URL or path could not be used.

§

HttpUnavailable

Smart HTTP requires the http-ureq feature or an injected HTTP client factory.

§

UnknownRemote

The argument is neither a configured remote name nor a URL or path.

Fields

§name: String

The argument as given.

§

RemoteExists

RepositoryRemotes::add found an existing remote.<name>.* section.

Fields

§name: String

The remote name.

§

InvalidRemoteName

The name cannot be used for a remote (refs/remotes/<name>/… would not be a valid ref).

Fields

§name: String

The name as given.

§

Auth

HTTP authentication failed.

Fields

§url: String

Repository URL with credentials redacted.

§reason: AuthFailure

What went wrong.

§

CredentialsUnavailable

A credential provider could not supply a complete username and password.

Fields

§helpers: Vec<String>

The credential.helper programs that were asked, in order.

§

PushAtomicUnsupported

An atomic wire push was requested, but the remote did not advertise atomic.

§

PushOptionsUnsupported

Push options were sent but the remote did not advertise push-options.

§

FetchUnshallowNotShallow

git fetch --unshallow on a repository that is not shallow.

§

FetchShallowUnsupported

A deepen/shallow fetch was requested but the remote did not advertise shallow.

§

FetchDeepenRelativeUnsupported

A --deepen fetch was requested but the remote did not advertise deepen-relative.

§

ReceivedPackTempMissing

Streaming fetch/clone temp pack disappeared before index-pack.

Fields

§path: PathBuf

Path to the temp pack that was expected on disk.

§

Unreadable

The remote could not be read or written at all.

Fields

§url: Option<String>

Remote URL or resolved local path, with credentials redacted.

§reason: RemoteUnreadableReason

What went wrong.

§

Fatal

The remote was reached but aborted with its own error text.

Fields

§message: String

The server’s message.

§

LocalUploadPack(Box<ServeError>)

The upload-pack serving a local path or file:// URL in this process failed.

§

Serve(ServeError)

Serving a fetch or push to a client failed at the protocol level.

§

LocalUploadPackPanicked

The thread serving a local path or file:// URL panicked.

§

Resumable(Box<ResumableError>)

A resumable bundle download or upload failed.

§

FetchRefspec(FetchRefspecError)

Explicit fetch refspec resolution failed.

§

FetchIntoCheckedOutBranch

Fetch refused to update the branch checked out in this or a linked worktree.

Fields

§branch: String

Short branch name under refs/heads/.

§

Protocol(ProtocolError)

Protocol allow/deny policy blocked the transport.

§

PushPlan(PushPlanError)

Push planning failed before the wire protocol ran.

§

PartialClone(PartialCloneError)

Partial-clone filter configuration failed.

§

MalformedTransportUrl

Malformed remote URL for a specific transport scheme.

Fields

§scheme: &'static str

git, ssh, http, or file.

§detail: String

Parse or validation detail.

§

Ssh

SSH subprocess or URL setup failed.

Fields

§detail: String

What failed while starting or talking to ssh.

§

Transport

Low-level transport failure (connection, DNS, TLS, or I/O outside HTTP status handling).

Fields

§url: Option<String>

Redacted repository URL when known.

§detail: String

What failed (for example connection refused).

§

HttpStatus

HTTP status from an embedder HttpClient outside auth/unreadable mapping.

Fields

§url: Option<String>

Redacted repository URL when known.

§status: u16

Response status code.

§

Http

HTTP client or worker failure outside unreadable/auth classification.

Fields

§detail: String

What the HTTP client reported.

§

HttpWorkerPanicked

HTTP worker thread panicked.

§

HttpLowSpeedStall

HTTP transfer stalled below the configured low-speed limit.

Fields

§detail: String

The transfer rate and limit that were crossed.

§

Credential

Credential helper or askpass failure.

Fields

§detail: String

What the credential helper or askpass reported.

§

Snapshot(CheckoutError)

A snapshot checkout from a grit server failed for a server-specific reason.

§

Clone(Box<CloneError>)

Clone-specific failure (destination not empty, missing --branch ref, failed checkout).

§

Bundle(BundleError)

A bundle used as a remote (or written for one) could not be read, written, or applied.

Implementations§

Source§

impl RemoteError

Source

pub fn from_io(err: Error) -> Self

Map a low-level I/O error to RemoteError::Transport.

Source

pub fn is_remote_unreadable(&self) -> bool

Whether the remote could not be read or written at all.

Source

pub fn kind_name(&self) -> &'static str

Stable slug aligned with former Error::kind_name values for absorbed variants.

Source

pub fn area(&self) -> &'static str

Functional area for analytics and JSON (area), matching Error::area when wrapped.

Source

pub fn unreadable( url: impl Into<String>, reason: RemoteUnreadableReason, ) -> Self

Build RemoteError::Unreadable for url.

Trait Implementations§

Source§

impl Debug for RemoteError

Source§

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

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

impl Display for RemoteError

Source§

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

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

impl Error for RemoteError

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

impl From<Box<ResumableError>> for RemoteError

Source§

fn from(source: Box<ResumableError>) -> Self

Converts to this type from the input type.
Source§

impl From<FetchRefspecError> for RemoteError

Source§

fn from(source: FetchRefspecError) -> Self

Converts to this type from the input type.
Source§

impl From<PartialCloneError> for RemoteError

Source§

fn from(source: PartialCloneError) -> Self

Converts to this type from the input type.
Source§

impl From<ProtocolError> for RemoteError

Source§

fn from(source: ProtocolError) -> Self

Converts to this type from the input type.
Source§

impl From<PushPlanError> for RemoteError

Source§

fn from(source: PushPlanError) -> Self

Converts to this type from the input type.
Source§

impl From<RemoteError> for Error

Source§

fn from(err: RemoteError) -> Self

Converts to this type from the input type.

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