consul syncer uses multi-error

This commit is contained in:
Alex Dadgar
2016-08-09 12:24:50 -07:00
parent 4e7e8d7c4c
commit 08628fea90

View File

@@ -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