chore(poll): return NotModifiedTimeoutErr on 304
This commit is contained in:
parent
35a3c1c23a
commit
bdf9298496
4 changed files with 65 additions and 1 deletions
|
@ -22,6 +22,7 @@ const CausalityTokenHeader = "X-Garage-Causality-Token"
|
|||
var TombstoneItemErr = errors.New("item is a tombstone")
|
||||
var NoSuchItemErr = errors.New("item does not exist")
|
||||
var ConcurrentItemsErr = errors.New("item has multiple concurrent values")
|
||||
var NotModifiedTimeoutErr = errors.New("not modified within timeout")
|
||||
|
||||
var awsSigner = v4.NewSigner()
|
||||
|
||||
|
@ -300,6 +301,8 @@ func (c *Client) readItemSingle(ctx context.Context, b Bucket, pk string, sk str
|
|||
return nil, "", NoSuchItemErr
|
||||
case http.StatusConflict:
|
||||
return nil, ct, ConcurrentItemsErr
|
||||
case http.StatusNotModified:
|
||||
return nil, "", NotModifiedTimeoutErr
|
||||
default:
|
||||
return nil, "", fmt.Errorf("http status code %d", resp.StatusCode)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue