pub use crate::share::errors::GitError; pub fn http_status(err: &GitError) -> u16 { match err { GitError::NotFound => 404, GitError::Unauthorized => 401, GitError::Forbidden => 403, GitError::Conflict(_) => 409, GitError::InvalidArgument(_) => 400, GitError::Unimplemented(_) => 501, GitError::Cache(_) | GitError::Git(_) | GitError::Internal(_) => 500, } }