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
This commit is contained in:
Harshavardhana
2015-01-24 15:35:01 -08:00
parent 72179fbc84
commit 357a81e879
4 changed files with 65 additions and 60 deletions

View File

@@ -10,16 +10,16 @@ type ObjectExists struct {
Key string
}
type BucketNameInvalid struct {
Bucket string
}
type BucketExists struct {
Bucket 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
}
@@ -35,3 +35,7 @@ func (self BucketNameInvalid) Error() string {
func (self BucketExists) Error() string {
return "Bucket exists: " + self.Bucket
}
func (self BucketNotFound) Error() string {
return "Bucket not Found: " + self.Bucket
}