From: Enming Zhang Date: Fri, 13 Oct 2017 09:00:15 +0000 (+0800) Subject: rgw: copy object add response error message X-Git-Tag: v13.0.1~460^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F18291%2Fhead;p=ceph.git rgw: copy object add response error message Signed-off-by: Enming Zhang --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 3fc2b51adbef..7d2ac9665c04 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -2102,7 +2102,8 @@ int RGWCopyObj_ObjStore_S3::get_params() } else if (!source_zone.empty()) { attrs_mod = RGWRados::ATTRSMOD_NONE; // default for intra-zone_group copy } else { - ldout(s->cct, 0) << "invalid metadata directive" << dendl; + s->err.message = "Unknown metadata directive."; + ldout(s->cct, 0) << s->err.message << dendl; return -EINVAL; } } @@ -2114,8 +2115,10 @@ int RGWCopyObj_ObjStore_S3::get_params() src_object.instance.empty() && (attrs_mod != RGWRados::ATTRSMOD_REPLACE)) { /* can only copy object into itself if replacing attrs */ - ldout(s->cct, 0) << "can't copy object into itself if not replacing attrs" - << dendl; + s->err.message = "This copy request is illegal because it is trying to copy " + "an object to itself without changing the object's metadata, " + "storage class, website redirect location or encryption attributes."; + ldout(s->cct, 0) << s->err.message << dendl; return -ERR_INVALID_REQUEST; } return 0;