From: Casey Bodley Date: Wed, 22 May 2024 20:54:13 +0000 (-0400) Subject: rgw: RGWDeleteMultiObj adds error messages X-Git-Tag: v20.0.0~1807^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1afb69a69e4c406d9fb03f69704e0980e389ee74;p=ceph.git rgw: RGWDeleteMultiObj adds error messages and consistently returns ERR_MALFORMED_XML for xml errors Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 95e382435bc4..c2a8d05bb061 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -12,6 +12,7 @@ #include #include #include +#include #include "include/scope_guard.h" #include "common/Clock.h" @@ -6788,13 +6789,15 @@ void RGWDeleteMultiObj::execute(optional_yield y) } if (!parser.parse(buf, data.length(), 1)) { - op_ret = -EINVAL; + s->err.message = "Failed to parse xml input"; + op_ret = -ERR_MALFORMED_XML; return; } auto multi_delete = static_cast(parser.find_first("Delete")); if (!multi_delete) { - op_ret = -EINVAL; + s->err.message = "Missing require element Delete"; + op_ret = -ERR_MALFORMED_XML; return; } @@ -6805,6 +6808,7 @@ void RGWDeleteMultiObj::execute(optional_yield y) } const int multi_delete_object_num = multi_delete->objects.size(); if (multi_delete_object_num > max_num) { + s->err.message = fmt::format("Object count limit {} exceeded", max_num); op_ret = -ERR_MALFORMED_XML; return; }