From 7a78bf48360ce4022dd591243f2ce0d61be7fb27 Mon Sep 17 00:00:00 2001 From: David Bresson Date: Thu, 11 Aug 2016 11:49:48 -0700 Subject: [PATCH] Add error handling to check registration --- command/agent/consul/syncer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/command/agent/consul/syncer.go b/command/agent/consul/syncer.go index 3accecc64..525b0aba8 100644 --- a/command/agent/consul/syncer.go +++ b/command/agent/consul/syncer.go @@ -707,7 +707,11 @@ func (c *Syncer) createCheckReg(check *structs.ServiceCheck, serviceReg *consul. Scheme: check.Protocol, Host: net.JoinHostPort(host, strconv.Itoa(port)), } - url := base.ResolveReference(url.Parse(check.Path)) + relative, err := url.Parse(check.Path) + if err != nil { + return nil, err + } + url := base.ResolveReference(relative) chkReg.HTTP = url.String() case structs.ServiceCheckTCP: chkReg.TCP = net.JoinHostPort(host, strconv.Itoa(port))