mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05: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