unthrowable_wrapper(const unthrowable_wrapper&) = delete;
static constexpr unthrowable_wrapper instance{};
- template <class T> friend const T& make_error();
+ [[nodiscard]] static const auto& make() {
+ return instance;
+ }
private:
// can be used only to initialize the `instance` member
explicit unthrowable_wrapper() = default;
};
-template <class T> [[nodiscard]] const T& make_error() {
- return T::instance;
-}
// TODO: let `exception` use other type than `ct_error`.
template <class ErrorT>
logger().debug("{} {} {} {}~{}",
__func__, c->get_cid(), oid, offset, len);
if (!c->exists) {
- return crimson::make_error<ceph::ct_error::enoent>();
+ return crimson::ct_error::enoent::make();
}
ObjectRef o = c->get_object(oid);
if (!o) {
- return crimson::make_error<ceph::ct_error::enoent>();
+ return crimson::ct_error::enoent::make();
}
if (offset >= o->get_size())
return seastar::make_ready_future<ceph::bufferlist>();
__func__, c->get_cid(), oid);
auto o = c->get_object(oid);
if (!o) {
- return crimson::make_error<crimson::ct_error::enoent>();
+ return crimson::ct_error::enoent::make();
}
if (auto found = o->xattr.find(name); found != o->xattr.end()) {
return seastar::make_ready_future<ceph::bufferptr>(found->second);
} else {
- return crimson::make_error<crimson::ct_error::enodata>();
+ return crimson::ct_error::enodata::make();
}
}
if (const bool is_fine = _read_verify_data(oi, bl); is_fine) {
return seastar::make_ready_future<bufferlist>(std::move(bl));
} else {
- return crimson::make_error<ceph::ct_error::object_corrupted>();
+ return crimson::ct_error::object_corrupted::make();
}
}, ll_read_errorator::pass_further{});
}