chore(poll): return NotModifiedTimeoutErr on 304

This commit is contained in:
Milas Bowman 2025-03-10 22:54:48 -04:00
parent 35a3c1c23a
commit bdf9298496
Signed by: milas
SSH key fingerprint: SHA256:ek2D5l1HA34B3wbdErz0QOXm1E46CVvyf/nM4Fwfx/U
4 changed files with 65 additions and 1 deletions

View file

@ -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)
}