Skip to content

Commit

Permalink
add not exist check
Browse files Browse the repository at this point in the history
  • Loading branch information
joeybrown-sf committed Jul 16, 2024
1 parent 1b5aa7c commit 6a779e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cache/volume_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ func (c *VolumeCache) RetrieveLayer(diffID string) (io.ReadCloser, error) {
if os.IsPermission(err) {
return nil, NewReadErr(fmt.Sprintf("failed to read cache layer with SHA '%s' due to insufficient permissions", diffID))
}
if os.IsNotExist(err) {
return nil, NewReadErr(fmt.Sprintf("failed to find cache layer with SHA '%s'", diffID))
}
return nil, fmt.Errorf("failed to get cache layer with SHA '%s'", diffID)
}
return file, nil
Expand Down

0 comments on commit 6a779e3

Please sign in to comment.