From bd8d6e3c4e51b9218027062a2782a9eb968cc5e8 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 11 Apr 2018 22:50:21 -0700 Subject: [PATCH] Return bucketNameInvalid properly in B2 gateway (#5787) Fixes #5758 --- cmd/gateway/b2/gateway-b2.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/gateway/b2/gateway-b2.go b/cmd/gateway/b2/gateway-b2.go index cc1a443da..e87d12d35 100644 --- a/cmd/gateway/b2/gateway-b2.go +++ b/cmd/gateway/b2/gateway-b2.go @@ -181,6 +181,15 @@ func b2ToObjectError(err error, params ...string) error { } else if bucket != "" { err = minio.BucketNotFound{Bucket: bucket} } + case "bad_json": + if object != "" { + err = minio.ObjectNameInvalid{ + Bucket: bucket, + Object: object, + } + } else if bucket != "" { + err = minio.BucketNameInvalid{Bucket: bucket} + } case "bad_bucket_id": err = minio.BucketNotFound{Bucket: bucket} case "file_not_present", "not_found":