Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "init4-bin-base"

description = "Internal utilities for binaries produced by the init4 team"
keywords = ["init4", "bin", "base"]
version = "0.18.0-rc.4"
version = "0.18.0-rc.5"
edition = "2021"
rust-version = "1.85"
authors = ["init4", "James Prestwich", "evalir"]
Expand Down
15 changes: 13 additions & 2 deletions src/perms/oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,19 @@ impl Authenticator {
debug!("Successfully refreshed oauth token");
}
Err(err) => {
let err_source = err.source().map(|e| e.to_string());
error!(%err, err_source, "Failed to refresh oauth token");
let mut current = &err as &dyn Error;

// This is a little hacky, but the oauth library nests
// errors quite deeply, so we need to walk the source chain
// to get the full picture.
let mut source_chain = Vec::new();
while let Some(source) = current.source() {
source_chain.push(source.to_string());
current = source;
}
let source_chain = source_chain.join("\n\n Caused by: \n");

error!(%err, %source_chain, "Failed to refresh oauth token");
}
};
let _sleep = tokio::time::sleep(tokio::time::Duration::from_secs(interval)).await;
Expand Down