From 72865524a3b247aa72b2e8bbdab3aa4c2abe04b9 Mon Sep 17 00:00:00 2001 From: urso Date: Tue, 6 Dec 2016 13:14:06 +0100 Subject: [PATCH] Fix heartbeat not accepting `mode` parameter --- heartbeat/monitors/util.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 {