minio/pkg/storage/storage_errors.go

42 lines
821 B
Go
Raw Normal View History

2015-01-21 02:16:06 -05:00
package storage
type GenericError struct {
2015-01-21 15:44:09 -05:00
Bucket string
Path string
2015-01-21 02:16:06 -05:00
}
type ObjectExists struct {
2015-01-21 15:44:09 -05:00
Bucket string
Key string
2015-01-21 02:16:06 -05:00
}
type ObjectNotFound GenericError
2015-01-21 03:50:23 -05:00
type GenericBucketError struct {
2015-01-21 15:44:09 -05:00
Bucket string
2015-01-21 03:50:23 -05:00
}
type BucketNameInvalid GenericBucketError
type BucketExists GenericBucketError
type BucketNotFound GenericBucketError
2015-01-21 02:16:06 -05:00
func (self ObjectNotFound) Error() string {
2015-01-21 15:44:09 -05:00
return "Object not Found: " + self.Bucket + "#" + self.Path
2015-01-21 02:16:06 -05:00
}
func (self ObjectExists) Error() string {
2015-01-21 15:44:09 -05:00
return "Object exists: " + self.Bucket + "#" + self.Key
2015-01-21 02:16:06 -05:00
}
2015-01-21 03:50:23 -05:00
func (self BucketNameInvalid) Error() string {
2015-01-21 15:44:09 -05:00
return "Bucket name invalid: " + self.Bucket
2015-01-21 03:50:23 -05:00
}
func (self BucketExists) Error() string {
2015-01-21 15:44:09 -05:00
return "Bucket exists: " + self.Bucket
2015-01-21 03:50:23 -05:00
}
func (self BucketNotFound) Error() string {
return "Bucket not Found: " + self.Bucket
}