api: Extend S3 errors with Minio errors. (#1533)

Fixes #1530
This commit is contained in:
Harshavardhana
2016-05-08 12:36:16 -07:00
committed by Anand Babu (AB) Periasamy
parent 75320f70d0
commit 76c511c9fe
3 changed files with 33 additions and 33 deletions

View File

@@ -46,7 +46,7 @@ func toObjectErr(err error, params ...string) error {
return InsufficientWriteQuorum{}
case errIsNotRegular, errFileAccessDenied:
if len(params) >= 2 {
return ObjectExistsAsPrefix{
return ObjectExistsAsDirectory{
Bucket: params[0],
Object: params[1],
}
@@ -112,11 +112,11 @@ func (e ObjectNotFound) Error() string {
return "Object not found: " + e.Bucket + "#" + e.Object
}
// ObjectExistsAsPrefix object already exists with a requested prefix.
type ObjectExistsAsPrefix GenericError
// ObjectExistsAsDirectory object already exists as a directory.
type ObjectExistsAsDirectory GenericError
func (e ObjectExistsAsPrefix) Error() string {
return "Object exists on : " + e.Bucket + " as prefix " + e.Object
func (e ObjectExistsAsDirectory) Error() string {
return "Object exists on : " + e.Bucket + " as directory " + e.Object
}
// BucketExists bucket exists.