mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-25 16:31:10 -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)
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(contents, "{") {
|
||||
return fmt.Errorf("contents of credentials are invalid")
|
||||
}
|
||||
|
||||
credOptions = append(credOptions, option.WithCredentialsJSON([]byte(contents)))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user