mirror of
https://github.com/zrepl/zrepl.git
synced 2025-08-18 18:58:15 +02:00
[#348] replication: return errors if .Send rpc returns a nil SendRes
discovered while developing the next commit in this series
This commit is contained in:
@@ -550,7 +550,12 @@ func (s *Step) updateSizeEstimate(ctx context.Context) error {
|
|||||||
log.WithError(err).Error("dry run send request failed")
|
log.WithError(err).Error("dry run send request failed")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
s.expectedSize = sres.ExpectedSize
|
if sres == nil {
|
||||||
|
err := fmt.Errorf("dry run send request returned nil send result")
|
||||||
|
log.Error(err.Error())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
s.expectedSize = sres.GetExpectedSize()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -581,6 +586,11 @@ func (s *Step) doReplication(ctx context.Context) error {
|
|||||||
log.WithError(err).Error("send request failed")
|
log.WithError(err).Error("send request failed")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if sres == nil {
|
||||||
|
err := fmt.Errorf("send request returned nil send result")
|
||||||
|
log.Error(err.Error())
|
||||||
|
return err
|
||||||
|
}
|
||||||
if stream == nil {
|
if stream == nil {
|
||||||
err := errors.New("send request did not return a stream, broken endpoint implementation")
|
err := errors.New("send request did not return a stream, broken endpoint implementation")
|
||||||
return err
|
return err
|
||||||
|
Reference in New Issue
Block a user