Skip to content

Commit

Permalink
Ignore 401 errors with multiple indexes (#3292)
Browse files Browse the repository at this point in the history
## Summary

It seems like Azure might return a 401 when you request a package that
doesn't exist (even with valid credentials)? But I admittedly haven't
tested this. (We already skip 403, and this seems similar?)

Closes #3291.
  • Loading branch information
charliermarsh committed Apr 28, 2024
1 parent 748ed66 commit eabefbf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/uv-client/src/registry_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl RegistryClient {
) -> Result<Vec<(IndexUrl, OwnedArchive<SimpleMetadata>)>, Error> {
let mut it = self.index_urls.indexes().peekable();
if it.peek().is_none() {
return Err(ErrorKind::NoIndex(package_name.as_ref().to_string()).into());
return Err(ErrorKind::NoIndex(package_name.to_string()).into());
}

let mut results = Vec::new();
Expand All @@ -239,6 +239,7 @@ impl RegistryClient {
ErrorKind::Offline(_) => continue,
ErrorKind::ReqwestError(err) => {
if err.status() == Some(StatusCode::NOT_FOUND)
|| err.status() == Some(StatusCode::UNAUTHORIZED)
|| err.status() == Some(StatusCode::FORBIDDEN)
{
continue;
Expand Down

0 comments on commit eabefbf

Please sign in to comment.