From: Radoslaw Zarzynski Date: Mon, 29 May 2017 17:08:21 +0000 (+0200) Subject: rgw: honor custom rgw_err::message in Swift's error handling. X-Git-Tag: v13.0.1~865^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e8516147d2926631fed98a793606bcbb0e6db9e1;p=ceph.git rgw: honor custom rgw_err::message in Swift's error handling. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 02b807efc1e4..a644c62b6755 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -341,7 +341,17 @@ void set_req_state_err(struct req_state* s, int err_no, const string& err_msg) { if (s) { set_req_state_err(s, err_no); - s->err.message = err_msg; + if (s->prot_flags & RGW_REST_SWIFT && !err_msg.empty()) { + /* TODO(rzarzynski): there never ever should be a check like this one. + * It's here only for the sake of the patch's backportability. Further + * commits will move the logic to a per-RGWHandler replacement of + * the end_header() function. Alternativaly, we might consider making + * that just for the dump(). Please take a look on @cbodley's comments + * in PR #10690 (https://github.com/ceph/ceph/pull/10690). */ + s->err.err_code = err_msg; + } else { + s->err.message = err_msg; + } } }