Skip to content

Commit 5cb47b1

Browse files
authored
Merge pull request #56 from maxlaverse/fix_error_message
fix error message when using session key for the first time
2 parents 6d07284 + 3a35ddc commit 5cb47b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/provider/provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ func ensureLoggedIn(d *schema.ResourceData, bwClient bw.Client) error {
175175
// Scenario 4: We need to login but don't have the information to do so.
176176
// This is a situation we can't get out from.
177177
// => failure
178-
if _, hasSessionKey := d.GetOk(attributeSessionKey); status.Status == bw.StatusLocked && hasSessionKey {
179-
return fmt.Errorf("unable to unlock Vault with provided session key")
178+
if _, hasSessionKey := d.GetOk(attributeSessionKey); hasSessionKey {
179+
return fmt.Errorf("unable to unlock Vault with provided session key (status: %s)", status.Status)
180180
}
181181

182182
// We should have caught already scenarios up to this point. If we haven't, it means this method's

0 commit comments

Comments
 (0)