rgw: RGWSI_RADOS::Pool::List::init() catches IoCtx::nobjects_begin() exceptions

Signed-off-by: lichaochao <lichaochao2_yewu@cmss.chinamobile.com>
This commit is contained in:
licc 2023-02-07 09:02:19 +01:00
parent 14176f00f4
commit 63c7d2a44b

View File

@ -330,11 +330,21 @@ int RGWSI_RADOS::Pool::List::init(const DoutPrefixProvider *dpp, const string& m
return -EINVAL;
}
ctx.iter = ctx.ioctx.nobjects_begin(oc);
ctx.filter = filter;
ctx.initialized = true;
return 0;
try {
ctx.iter = ctx.ioctx.nobjects_begin(oc);
ctx.filter = filter;
ctx.initialized = true;
return 0;
} catch (const std::system_error& e) {
r = -e.code().value();
ldpp_dout(dpp, 10) << "nobjects_begin threw " << e.what()
<< ", returning " << r << dendl;
return r;
} catch (const std::exception& e) {
ldpp_dout(dpp, 10) << "nobjects_begin threw " << e.what()
<< ", returning -5" << dendl;
return -EIO;
}
}
int RGWSI_RADOS::Pool::List::get_next(const DoutPrefixProvider *dpp,