File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name = "init4-bin-base"
33
44description = " Internal utilities for binaries produced by the init4 team"
55keywords = [" init4" , " bin" , " base" ]
6- version = " 0.18.0-rc.4 "
6+ version = " 0.18.0-rc.5 "
77edition = " 2021"
88rust-version = " 1.85"
99authors = [" init4" , " James Prestwich" , " evalir" ]
Original file line number Diff line number Diff line change @@ -168,8 +168,19 @@ impl Authenticator {
168168 debug ! ( "Successfully refreshed oauth token" ) ;
169169 }
170170 Err ( err) => {
171- let err_source = err. source ( ) . map ( |e| e. to_string ( ) ) ;
172- error ! ( %err, err_source, "Failed to refresh oauth token" ) ;
171+ let mut current = & err as & dyn Error ;
172+
173+ // This is a little hacky, but the oauth library nests
174+ // errors quite deeply, so we need to walk the source chain
175+ // to get the full picture.
176+ let mut source_chain = Vec :: new ( ) ;
177+ while let Some ( source) = current. source ( ) {
178+ source_chain. push ( source. to_string ( ) ) ;
179+ current = source;
180+ }
181+ let source_chain = source_chain. join ( "\n \n Caused by: \n " ) ;
182+
183+ error ! ( %err, %source_chain, "Failed to refresh oauth token" ) ;
173184 }
174185 } ;
175186 let _sleep = tokio:: time:: sleep ( tokio:: time:: Duration :: from_secs ( interval) ) . await ;
You can’t perform that action at this time.
0 commit comments