#[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
NoUrl
A remote has no URL: remote.<name>.url is unset or blank, or a literal URL was empty.
Fields
UnsupportedScheme
The URL uses a scheme grit does not support for remotes.
InvalidUrl
A URL or path failed to parse.
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.
RemoteExists
RepositoryRemotes::add found an
existing remote.<name>.* section.
InvalidRemoteName
The name cannot be used for a remote (refs/remotes/<name>/… would not be a valid ref).
Auth
HTTP authentication failed.
A credential provider could not supply a complete username and password.
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.
Unreadable
The remote could not be read or written at all.
Fields
reason: RemoteUnreadableReasonWhat went wrong.
Fatal
The remote was reached but aborted with its own error text.
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.
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.
Ssh
SSH subprocess or URL setup failed.
Transport
Low-level transport failure (connection, DNS, TLS, or I/O outside HTTP status handling).
Fields
HttpStatus
HTTP status from an embedder HttpClient outside auth/unreadable mapping.
Http
HTTP client or worker failure outside unreadable/auth classification.
HttpWorkerPanicked
HTTP worker thread panicked.
HttpLowSpeedStall
HTTP transfer stalled below the configured low-speed limit.
Credential
Credential helper or askpass failure.
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
impl RemoteError
Sourcepub fn from_io(err: Error) -> Self
pub fn from_io(err: Error) -> Self
Map a low-level I/O error to RemoteError::Transport.
Sourcepub fn is_remote_unreadable(&self) -> bool
pub fn is_remote_unreadable(&self) -> bool
Whether the remote could not be read or written at all.
Sourcepub fn kind_name(&self) -> &'static str
pub fn kind_name(&self) -> &'static str
Stable slug aligned with former Error::kind_name values for absorbed variants.
Sourcepub fn area(&self) -> &'static str
pub fn area(&self) -> &'static str
Functional area for analytics and JSON (area), matching Error::area when wrapped.
Sourcepub fn unreadable(
url: impl Into<String>,
reason: RemoteUnreadableReason,
) -> Self
pub fn unreadable( url: impl Into<String>, reason: RemoteUnreadableReason, ) -> Self
Build RemoteError::Unreadable for url.
Trait Implementations§
Source§impl Debug for RemoteError
impl Debug for RemoteError
Source§impl Display for RemoteError
impl Display for RemoteError
Source§impl Error for RemoteError
impl Error for RemoteError
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()