File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -553,9 +553,10 @@ func initClient(saveConfig bool) (*api.Client, error) {
553
553
Str ("providerProfile" , providerProfile ).
554
554
Msg ("enter: initClient()" )
555
555
var (
556
- c * api.Client
557
- envCfgErr error
558
- cfgErr error
556
+ c * api.Client
557
+ envCfgErr error
558
+ cfgErr error
559
+ explicitCfgErr error
559
560
)
560
561
561
562
if providerType != "" {
@@ -572,14 +573,20 @@ func initClient(saveConfig bool) (*api.Client, error) {
572
573
Str ("configFile" , configFile ).
573
574
Str ("profile" , profile ).
574
575
Msg ("authenticating via config file" )
575
- c , cfgErr = authViaConfigFile (configFile , profile )
576
- if cfgErr == nil {
576
+ c , explicitCfgErr = authViaConfigFile (configFile , profile )
577
+ if explicitCfgErr == nil {
577
578
log .Info ().
578
579
Str ("configFile" , configFile ).
579
580
Str ("profile" , profile ).
580
581
Msgf ("Authenticated via config file %s using profile %s" , configFile , profile )
581
582
return c , nil
582
583
}
584
+ log .Error ().
585
+ Err (explicitCfgErr ).
586
+ Str ("configFile" , configFile ).
587
+ Str ("profile" , profile ).
588
+ Msg ("unable to authenticate using explicit config file and/or profile" )
589
+ return nil , explicitCfgErr // return explicit error
583
590
}
584
591
585
592
log .Info ().Msg ("authenticating via environment variables" )
You can’t perform that action at this time.
0 commit comments