From 7bf684ece1238cb48634f491f594ed0fa90e0210 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Tue, 26 Apr 2016 15:03:26 -0700 Subject: [PATCH] Fixes some bad error returns in the persist service and check paths. --- command/agent/agent.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/agent/agent.go b/command/agent/agent.go index c0880a4fc6..d4e7faa50b 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -669,7 +669,7 @@ func (a *Agent) persistService(service *structs.NodeService) error { } encoded, err := json.Marshal(wrapped) if err != nil { - return nil + return err } if err := os.MkdirAll(filepath.Dir(svcPath), 0700); err != nil { return err @@ -707,7 +707,7 @@ func (a *Agent) persistCheck(check *structs.HealthCheck, chkType *CheckType) err encoded, err := json.Marshal(wrapped) if err != nil { - return nil + return err } if err := os.MkdirAll(filepath.Dir(checkPath), 0700); err != nil { return err