diff --git a/agent/consul/client.go b/agent/consul/client.go index ac64d704ab..999f986634 100644 --- a/agent/consul/client.go +++ b/agent/consul/client.go @@ -347,7 +347,7 @@ func (c *Client) SnapshotRPC(args *structs.SnapshotRequest, in io.Reader, out io // Let the caller peek at the reply. if replyFn != nil { if err := replyFn(&reply); err != nil { - return nil + return err } } diff --git a/agent/consul/server.go b/agent/consul/server.go index 91082a7d6b..e076af7214 100644 --- a/agent/consul/server.go +++ b/agent/consul/server.go @@ -1347,7 +1347,7 @@ func (s *Server) SnapshotRPC(args *structs.SnapshotRequest, in io.Reader, out io // Let the caller peek at the reply. if replyFn != nil { if err := replyFn(&reply); err != nil { - return nil + return err } }