crimson/common/errorator: fix finally

We need to specify the return type here to ensure we don't lose
the errorator properties.

Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
Samuel Just 2020-09-28 13:48:27 -07:00 committed by Kefu Chai
parent ba055a743c
commit c820d40aca

View File

@ -596,14 +596,14 @@ private:
}
template <class FuncT>
auto finally(FuncT &&func) {
_future finally(FuncT &&func) {
return this->then_wrapped(
[func = std::forward<FuncT>(func)](auto &&result) mutable noexcept {
if constexpr (seastar::is_future<std::invoke_result_t<FuncT>>::value) {
return ::seastar::futurize_invoke(std::forward<FuncT>(func)).then_wrapped(
[result = std::move(result)](auto&& f_res) mutable {
// TODO: f_res.failed()
f_res.discard_result();
(void)f_res.discard_result();
return std::move(result);
});
} else {