mirror of
https://github.com/zrepl/zrepl.git
synced 2025-08-08 23:04:46 +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")
|
||||
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
|
||||
}
|
||||
|
||||
@ -581,6 +586,11 @@ func (s *Step) doReplication(ctx context.Context) error {
|
||||
log.WithError(err).Error("send request failed")
|
||||
return err
|
||||
}
|
||||
if sres == nil {
|
||||
err := fmt.Errorf("send request returned nil send result")
|
||||
log.Error(err.Error())
|
||||
return err
|
||||
}
|
||||
if stream == nil {
|
||||
err := errors.New("send request did not return a stream, broken endpoint implementation")
|
||||
return err
|
||||
|
Reference in New Issue
Block a user