mirror of https://github.com/status-im/consul.git
snapshot: return the error from replyFn
The only function passed to SnapshotRPC today always returns a nil error, so there's no way to exercise this bug in practice. This change is being made for correctness so that it doesn't become a problem in the future, if we ever pass a different function to SnapshotRPC.
This commit is contained in:
parent
ff7f3a9737
commit
abfc1e4840
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue