Skip to content

Commit

Permalink
Forgot to handle another potential error
Browse files Browse the repository at this point in the history
  • Loading branch information
sergi0g committed Aug 31, 2024
1 parent def2efa commit 7292ed3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ pub fn check_auth(registry: &str, config: &JsonValue) -> Option<String> {
Some(challenge) => Some(parse_www_authenticate(challenge)),
None => error!("Unauthorized to access registry {} and no way to authenticate was provided", registry),
},
Err(Error::Transport(error)) => {
match error.kind() {
ErrorKind::Dns => {
warn!("Failed to lookup the IP of the registry, retrying.");
return check_auth(registry, config)
}, // If something goes really wrong, this can get stuck in a loop
ErrorKind::ConnectionFailed => {
warn!("Connection probably timed out, retrying.");
return check_auth(registry, config)
}, // Same here
_ => error!("{}", error)
}
},
Err(e) => error!("{}", e),
}
}
Expand Down

0 comments on commit 7292ed3

Please sign in to comment.