diff --git a/heartbeat/monitors/util.go b/heartbeat/monitors/util.go index 71f07bff394..9045d6a6b71 100644 --- a/heartbeat/monitors/util.go +++ b/heartbeat/monitors/util.go @@ -287,8 +287,10 @@ func (p *PingMode) Unpack(s string) error { *p = PingAll case "any": *p = PingAny + default: + return fmt.Errorf("expecting 'any' or 'all', not '%v'", s) } - return errors.New("expecting 'any' or 'all'") + return nil } func annotated(start time.Time, typ string, fn func() (common.MapStr, []TaskRunner, error)) TaskRunner {