return store.ErrNotFound (#1332)

This commit is contained in:
Asim Aslam 2020-03-11 23:09:42 +00:00 committed by GitHub
parent f55493993c
commit 1ca4619506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -218,6 +218,10 @@ func (w *workersKV) Read(key string, opts ...store.ReadOption) ([]*store.Record,
return records, err
}
if status < 200 || status >= 300 {
if status == 404 {
return nil, store.ErrNotFound
}
return records, errors.New("Received unexpected Status " + strconv.Itoa(status) + string(response))
}
record := &store.Record{