Skip to content

Commit

Permalink
Explicitly propagate 401 errors early
Browse files Browse the repository at this point in the history
  • Loading branch information
rsdy committed Aug 24, 2023
1 parent 582d599 commit 97a38e3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/bleep/src/background/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,18 @@ impl SyncHandle {
let loop_max = 1;
let git_err = loop {
match creds.git_sync(&self.reporef, repo.clone()).await {
Err(
err @ RemoteError::GitCloneFetch(gix::clone::fetch::Error::PrepareFetch(
gix::remote::fetch::prepare::Error::RefMap(
gix::remote::ref_map::Error::Handshake(
gix::protocol::handshake::Error::InvalidCredentials { .. },
),
),
)),
) => {
error!(?err, ?self.reporef, "invalid credentials for accessing git repo");
return Err(SyncError::Sync(err));
}
Err(
err @ RemoteError::GitOpen(_)
| err @ RemoteError::GitFetch(_)
Expand Down

0 comments on commit 97a38e3

Please sign in to comment.