From 8571221f03c92ac3acac27c240fa7c9b3cb22db5 Mon Sep 17 00:00:00 2001 From: Scott Miller Date: Mon, 27 Apr 2020 13:39:06 -0500 Subject: [PATCH] Handle request errors during raft snapshot (#8861) * Handle request errors during raft snapshot --- api/sys_raft.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/sys_raft.go b/api/sys_raft.go index 908a3c4f1131..1a8aa1176b63 100644 --- a/api/sys_raft.go +++ b/api/sys_raft.go @@ -92,6 +92,10 @@ func (c *Sys) RaftSnapshot(snapWriter io.Writer) error { // to determine if the body contains error message. var result *Response resp, err := c.c.config.HttpClient.Do(req) + if err != nil { + return err + } + if resp == nil { return nil }