pub enum GitError {
PathTraversal(String),
Unauthorised(String),
NotARepository(String),
BackendNotAvailable(String),
BackendFailed {
exit_code: Option<i32>,
stderr: String,
},
MalformedCgi(String),
Io(Error),
Auth(AuthError),
}Expand description
All failure modes the Git HTTP service may surface.
Variants§
PathTraversal(String)
Path-traversal attempt or otherwise invalid URL. JSS returns 400 for malformed requests and 403 for traversal; we fold both into a single 400 per Rust idiom (the leakage surface is identical — the client must not learn whether a repo exists via the status code).
Authorisation required but missing / malformed / rejected.
NotARepository(String)
The request targets a path that is not a git repository.
BackendNotAvailable(String)
git-http-backend (or git) binary not installed in PATH.
Distinguished from a generic I/O error so callers can gate
integration tests.
BackendFailed
The CGI process exited non-zero before emitting headers.
Fields
MalformedCgi(String)
The CGI process emitted malformed output.
Io(Error)
Generic underlying I/O failure.
Auth(AuthError)
Underlying auth-layer error (NIP-98 decode, Schnorr mismatch, …).
Implementations§
Trait Implementations§
Source§impl Error for GitError
impl Error for GitError
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()
Auto Trait Implementations§
impl Freeze for GitError
impl !RefUnwindSafe for GitError
impl Send for GitError
impl Sync for GitError
impl Unpin for GitError
impl UnsafeUnpin for GitError
impl !UnwindSafe for GitError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.