Skip to content

Commit 6959155

Browse files
committed
fix(server): return error if trying to parse addresses from invalid type
1 parent 2f6c489 commit 6959155

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/commands/server/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ func (s *createCommand) ExecuteWithoutArguments(exec commands.Executor) (output.
378378
func formatIPAddresses(val interface{}) (text.Colors, string, error) {
379379
server, ok := val.(*upcloud.ServerDetails)
380380
if !ok {
381-
return nil, fmt.Sprint(val), nil
381+
return nil, "", fmt.Errorf("cannot parse IP addresses from %T, expected *upcloud.ServerDetails", val)
382382
}
383383

384384
// Store addresses in map keys to avoid duplicate addresses

0 commit comments

Comments
 (0)