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:
Harshavardhana
2015-04-26 21:15:43 -07:00
parent f20515b4ed
commit 8beca83090
5 changed files with 26 additions and 1 deletions

View File

@@ -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