diff --git a/crates/forge-forgejo/src/branch/get_all.rs b/crates/forge-forgejo/src/branch/get_all.rs index 53e0e9b..b88f573 100644 --- a/crates/forge-forgejo/src/branch/get_all.rs +++ b/crates/forge-forgejo/src/branch/get_all.rs @@ -2,7 +2,6 @@ use git_next_config as config; use git_next_git as git; use kxio::network::{self, Network}; -use tracing::error; pub async fn get_all( repo_details: &git::RepoDetails, @@ -16,7 +15,6 @@ pub async fn get_all( "https://{hostname}/api/v1/repos/{repo_path}/branches?token={token}" )); - // info!(%url, "Listing branches"); let request = network::NetRequest::new( network::RequestMethod::Get, url, @@ -26,11 +24,7 @@ pub async fn get_all( None, network::NetRequestLogging::None, ); - let result = net.get::>(request).await; - let response = result.map_err(|e| { - error!(?e, "Failed to list branches"); - git::branch::Error::NoneFound // BranchListNotAvailable - })?; + let response = net.get::>(request).await?; let branches = response .response_body() .unwrap_or_default() diff --git a/crates/git/src/branch.rs b/crates/git/src/branch.rs index cde6804..48204e5 100644 --- a/crates/git/src/branch.rs +++ b/crates/git/src/branch.rs @@ -1,8 +1,6 @@ -#[derive(Debug, derive_more::Display)] +#[derive(Debug, derive_more::Display, derive_more::From)] pub enum Error { - #[display("Branch not found: {}", 0)] - NotFound(git_next_config::BranchName), - #[display("Unable to find any branches")] - NoneFound, + #[display("network: {}", 0)] + Network(kxio::network::NetworkError), } impl std::error::Error for Error {}