Skip to content

Commit 0deb3fb

Browse files
committed
Hande 404 better
1 parent 8dd4f4d commit 0deb3fb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

registry/storage/driver/bunny/bunny.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,13 @@ func (d *driver) Stat(ctx context.Context, path string) (storagedriver.FileInfo,
160160
fmt.Println("Getting file info for path:", path)
161161
info, err := d.client.Describe(path)
162162
if err != nil {
163-
return nil, err
163+
if err.Error() == "Not Found" {
164+
fmt.Println("File not found:", path)
165+
return nil, storagedriver.PathNotFoundError{Path: path}
166+
} else {
167+
fmt.Println("Error describing file:", err)
168+
return nil, err
169+
}
164170
}
165171
modTime, err := time.Parse("2006-01-02T15:04:05.000", info.LastChanged)
166172
if err != nil {

0 commit comments

Comments
 (0)