minio/pkg/storage/storage_errors.go
Harshavardhana 357a81e879 Add bucket to be part of object struct, reply back with BucketNotFound
for erroneous Object Put requests.

Other minor cleanups, to follow

  - https://github.com/golang/go/wiki/CodeReviewComments
2015-01-24 15:35:05 -08:00

42 lines
821 B
Go

package storage
type GenericError struct {
Bucket string
Path string
}
type ObjectExists struct {
Bucket string
Key string
}
type ObjectNotFound GenericError
type GenericBucketError struct {
Bucket string
}
type BucketNameInvalid GenericBucketError
type BucketExists GenericBucketError
type BucketNotFound GenericBucketError
func (self ObjectNotFound) Error() string {
return "Object not Found: " + self.Bucket + "#" + self.Path
}
func (self ObjectExists) Error() string {
return "Object exists: " + self.Bucket + "#" + self.Key
}
func (self BucketNameInvalid) Error() string {
return "Bucket name invalid: " + self.Bucket
}
func (self BucketExists) Error() string {
return "Bucket exists: " + self.Bucket
}
func (self BucketNotFound) Error() string {
return "Bucket not Found: " + self.Bucket
}