mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 12:10:24 +03:00
Reply back errors properly
This commit is contained in:
@@ -153,6 +153,11 @@ func (storage *storage) ListObjects(bucket, prefix string, count int) ([]mstorag
|
||||
|
||||
rootPrefix := path.Join(storage.root, bucket)
|
||||
|
||||
// check bucket exists
|
||||
if _, err := os.Stat(rootPrefix); os.IsNotExist(err) {
|
||||
return []mstorage.ObjectMetadata{}, false, mstorage.BucketNotFound{Bucket: bucket}
|
||||
}
|
||||
|
||||
files, err := ioutil.ReadDir(rootPrefix)
|
||||
if err != nil {
|
||||
return []mstorage.ObjectMetadata{}, false, mstorage.EmbedError("bucket", "", err)
|
||||
|
||||
Reference in New Issue
Block a user