From 08628fea9058aeff80f9320cd350453a048f6153 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Tue, 9 Aug 2016 12:24:50 -0700 Subject: [PATCH] consul syncer uses multi-error --- command/agent/consul/syncer.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/command/agent/consul/syncer.go b/command/agent/consul/syncer.go index dd8e8e88c..75d07120c 100644 --- a/command/agent/consul/syncer.go +++ b/command/agent/consul/syncer.go @@ -826,17 +826,17 @@ func (c *Syncer) RunHandlers() error { // SyncServices sync the services with the Consul Agent func (c *Syncer) SyncServices() error { + var mErr multierror.Error + if err := c.syncServices(); err != nil { + mErr.Errors = append(mErr.Errors, err) + } + if err := c.syncChecks(); err != nil { + mErr.Errors = append(mErr.Errors, err) + } if err := c.RunHandlers(); err != nil { return err } - if err := c.syncServices(); err != nil { - return err - } - if err := c.syncChecks(); err != nil { - return err - } - - return nil + return mErr.ErrorOrNil() } // filterConsulServices prunes out all the service who were not registered with