Skip to content

Commit

Permalink
retry on error posting to AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmorley committed Jul 27, 2021
1 parent fdbcdb0 commit eaf13dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/config/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ impl ProfileConfig {
default_role: Option<String>,
) -> Result<(String, Self)> {
let response = client.get_saml_response(link.link_url.clone()).await?;
let aws_response = response.post_to_aws().await?;
let aws_response = match response.post_to_aws().await {
Err(e) => {
warn!("Caught error trying to login to AWS: {}, trying again", e);
response.post_to_aws().await
}
ok => ok,
}?;
let aws_response_text = aws_response.text().await?;

let roles = response.clone().roles;
Expand Down

0 comments on commit eaf13dc

Please sign in to comment.