Skip to content

Commit

Permalink
keep context in ssh key fetch errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Jan 3, 2024
1 parent 0006ca6 commit 77f3840
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builder/hcloud/step_create_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ func (s *stepCreateServer) Run(ctx context.Context, state multistep.StateBag) mu
for _, k := range c.SSHKeys {
sshKey, _, err := client.SSHKey.Get(ctx, k)
if err != nil {
return errorHandler(state, ui, "Could not fetch SSH key", err)
return errorHandler(state, ui, fmt.Sprintf("Could not fetch SSH key '%s'", k), err)
}
if sshKey == nil {
return errorHandler(state, ui, "Could not find SSH key", err)
return errorHandler(state, ui, fmt.Sprintf("Could not find SSH key '%s'", k), err)
}
sshKeys = append(sshKeys, sshKey)
}
Expand Down

0 comments on commit 77f3840

Please sign in to comment.