mirror of
https://github.com/versity/versitygw.git
synced 2026-04-23 14:10:29 +00:00
fix: Error handling for posix DeleteObject function to return an error when the object doesn't exist
This commit is contained in:
@@ -921,7 +921,7 @@ func (p *Posix) DeleteObject(bucket, object string) error {
|
||||
return fmt.Errorf("stat bucket: %w", err)
|
||||
}
|
||||
|
||||
os.Remove(filepath.Join(bucket, object))
|
||||
err = os.Remove(filepath.Join(bucket, object))
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
return s3err.GetAPIError(s3err.ErrNoSuchKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user