mirror of
https://github.com/minio/minio.git
synced 2025-11-29 13:28:17 -05:00
Limit memory mode at 100 buckets and return error appropriately
~~~ mc: <ERROR> Failed to create bucket for URL [http://localhost:9000/newbucket-101]. Reason: [You have attempted to create more buckets than allowed.]. ~~~ Response from server
This commit is contained in:
@@ -78,6 +78,9 @@ type BucketExists GenericBucketError
|
||||
// BucketNotFound - requested bucket not found
|
||||
type BucketNotFound GenericBucketError
|
||||
|
||||
// TooManyBuckets - total buckets exceeded
|
||||
type TooManyBuckets GenericBucketError
|
||||
|
||||
/// Object related errors
|
||||
|
||||
// ObjectNotFound - requested object not found
|
||||
@@ -149,6 +152,11 @@ func (e BucketExists) Error() string {
|
||||
return "Bucket exists: " + e.Bucket
|
||||
}
|
||||
|
||||
// Return string an error formatted as the given text
|
||||
func (e TooManyBuckets) Error() string {
|
||||
return "Bucket limit exceeded beyond 100, cannot create bucket: " + e.Bucket
|
||||
}
|
||||
|
||||
// Return string an error formatted as the given text
|
||||
func (e BucketNotFound) Error() string {
|
||||
return "Bucket not Found: " + e.Bucket
|
||||
|
||||
Reference in New Issue
Block a user