···6060}
61616262// Get returns an object, it follows the original pattern in larry to return redis.Nil when an object
6363-// does not exist, in other case we can use minio.ToErrorResponse(err) to extract more details about the
6464-// potential S3 related error
6363+// does not exist. Other S3 errors (network, 5xx, auth) are propagated so callers can distinguish a
6464+// genuine cache miss from a transient failure.
6565func (c *CacheClientS3) Get(key string) (string, error) {
6666- // First check if object exists and get its metadata
6766 objInfo, err := c.mc.StatObject(c.ctx, c.bucket, key, minio.StatObjectOptions{})
6867 if err != nil {
6969- return "", redis.Nil
6868+ if minio.ToErrorResponse(err).Code == "NoSuchKey" {
6969+ return "", redis.Nil
7070+ }
7171+ return "", err
7072 }
71737274 if expiresAt, ok := objInfo.UserMetadata["expires-at"]; ok {