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()