Skip to content

Commit 7bd1709

Browse files
author
Matthew Fisher
committed
fix(client): return error if unit list is empty
1 parent 1f79c8b commit 7bd1709

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

client/unit.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ func (c *FleetClient) Units(target string) (units []string, err error) {
4040
units = append(units, u.Name)
4141
}
4242
}
43+
if len(units) == 0 {
44+
err = fmt.Errorf("could not find unit: %s", target)
45+
}
4346
return
4447
}
4548

0 commit comments

Comments
 (0)