mirror of
https://github.com/minio/minio.git
synced 2025-11-11 14:30:17 -05:00
Adding storage modifications for upcoming fs system
This commit is contained in:
@@ -10,18 +10,50 @@ type ObjectExists struct {
|
||||
Key string
|
||||
}
|
||||
|
||||
type ObjectNotFound GenericError
|
||||
type ObjectNotFound GenericObjectError
|
||||
|
||||
type GenericBucketError struct {
|
||||
Bucket string
|
||||
}
|
||||
|
||||
type GenericObjectError struct {
|
||||
Bucket string
|
||||
Object string
|
||||
}
|
||||
|
||||
type ImplementationError struct {
|
||||
Bucket string
|
||||
Object string
|
||||
Err error
|
||||
}
|
||||
|
||||
func (self ImplementationError) Error() string {
|
||||
error := ""
|
||||
if self.Bucket != "" {
|
||||
error = error + "Bucket: " + self.Bucket + " "
|
||||
}
|
||||
if self.Object != "" {
|
||||
error = error + "Object: " + self.Object + " "
|
||||
}
|
||||
error = error + "Error: " + self.Err.Error()
|
||||
return error
|
||||
}
|
||||
|
||||
func EmbedError(bucket, object string, err error) ImplementationError {
|
||||
return ImplementationError{
|
||||
Bucket: bucket,
|
||||
Object: object,
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
|
||||
type BucketNameInvalid GenericBucketError
|
||||
type BucketExists GenericBucketError
|
||||
type BucketNotFound GenericBucketError
|
||||
type ObjectNameInvalid GenericObjectError
|
||||
|
||||
func (self ObjectNotFound) Error() string {
|
||||
return "Object not Found: " + self.Bucket + "#" + self.Path
|
||||
return "Object not Found: " + self.Bucket + "#" + self.Object
|
||||
}
|
||||
|
||||
func (self ObjectExists) Error() string {
|
||||
@@ -39,3 +71,7 @@ func (self BucketExists) Error() string {
|
||||
func (self BucketNotFound) Error() string {
|
||||
return "Bucket not Found: " + self.Bucket
|
||||
}
|
||||
|
||||
func (self ObjectNameInvalid) Error() string {
|
||||
return "Object name invalid: " + self.Bucket + "#" + self.Object
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user