mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-26 08:51:02 -06:00
add better error if credentials are invalid
This commit is contained in:
parent
d05fa3049e
commit
348c761bea
@ -141,6 +141,10 @@ func (b *Backend) configure(ctx context.Context) error {
|
|||||||
return fmt.Errorf("Error loading credentials: %s", err)
|
return fmt.Errorf("Error loading credentials: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !strings.HasPrefix(contents, "{") {
|
||||||
|
return fmt.Errorf("contents of credentials are invalid")
|
||||||
|
}
|
||||||
|
|
||||||
credOptions = append(credOptions, option.WithCredentialsJSON([]byte(contents)))
|
credOptions = append(credOptions, option.WithCredentialsJSON([]byte(contents)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user