Merge pull request #833 from abhinavdangeti/master
Return an error when the snapshotEpoch is invalid
This commit is contained in:
commit
a4d88f8a12
|
@ -514,7 +514,7 @@ func (s *Scorch) LoadSnapshot(epoch uint64) (rv *IndexSnapshot, err error) {
|
||||||
snapshotKey := segment.EncodeUvarintAscending(nil, epoch)
|
snapshotKey := segment.EncodeUvarintAscending(nil, epoch)
|
||||||
snapshot := snapshots.Bucket(snapshotKey)
|
snapshot := snapshots.Bucket(snapshotKey)
|
||||||
if snapshot == nil {
|
if snapshot == nil {
|
||||||
return nil
|
return fmt.Errorf("snapshot with epoch: %v - doesn't exist", epoch)
|
||||||
}
|
}
|
||||||
rv, err = s.loadSnapshot(snapshot)
|
rv, err = s.loadSnapshot(snapshot)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue