From 2ebe85414f58d920f3651183eaf56e26c34b0d0c Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Mon, 24 Nov 2014 01:58:39 -0800 Subject: [PATCH] agent: pass error through when writing state files --- command/agent/agent.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/command/agent/agent.go b/command/agent/agent.go index e3e1cddb3c..82cc62f78e 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -645,7 +645,9 @@ func (a *Agent) AddService(service *structs.NodeService, chkType *CheckType) err a.state.AddService(service) // Persist the service to a file - a.persistService(service) + if err := a.persistService(service); err != nil { + return err + } // Create an associated health check if chkType != nil {