Adds a check for in-band error returns in the coordinate RaftApply.

This commit is contained in:
James Phillips 2015-11-14 15:44:26 -08:00
parent a4b53aa531
commit 9972eb2498

View File

@ -92,9 +92,13 @@ func (c *Coordinate) batchApplyUpdates() error {
t := structs.CoordinateBatchUpdateType | structs.IgnoreUnknownTypeFlag
slice := updates[start:end]
if _, err := c.srv.raftApply(t, slice); err != nil {
resp, err := c.srv.raftApply(t, slice)
if err != nil {
return err
}
if respErr, ok := resp.(error); ok {
return respErr
}
}
return nil
}