Skip to content

Commit

Permalink
feat: display the underlying permission denied error as source when f…
Browse files Browse the repository at this point in the history
…ailng handshake due to authentication.
  • Loading branch information
Byron committed Dec 29, 2022
1 parent 511ed00 commit 4b8abb0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion git-protocol/src/handshake/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ where
// Still no permission? Reject the credentials.
Err(client::Error::Io(err)) if err.kind() == std::io::ErrorKind::PermissionDenied => {
authenticate(next.erase())?;
return Err(Error::InvalidCredentials { url });
return Err(Error::InvalidCredentials { url, source: err });
}
// Otherwise, do nothing, as we don't know if it actually got to try the credentials.
// If they were previously stored, they remain. In the worst case, the user has to enter them again
Expand Down
2 changes: 1 addition & 1 deletion git-protocol/src/handshake/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ mod error {
#[error("Failed to obtain credentials")]
Credentials(#[from] credentials::protocol::Error),
#[error("Credentials provided for \"{url}\" were not accepted by the remote")]
InvalidCredentials { url: BString },
InvalidCredentials { url: BString, source: std::io::Error },
#[error(transparent)]
Transport(#[from] client::Error),
#[error("The transport didn't accept the advertised server version {actual_version:?} and closed the connection client side")]
Expand Down

0 comments on commit 4b8abb0

Please sign in to comment.