24#include <seastar/core/future.hh>
32struct exception_awaiter {
33 std::exception_ptr eptr;
35 explicit exception_awaiter(std::exception_ptr&& eptr) noexcept : eptr(std::move(eptr)) {}
37 exception_awaiter(
const exception_awaiter&) =
delete;
38 exception_awaiter(exception_awaiter&&) =
delete;
40 bool await_ready() const noexcept {
45 void await_suspend(std::coroutine_handle<U> hndl)
noexcept {
50 void await_resume() noexcept {}
72 std::exception_ptr eptr;
73 explicit exception(std::exception_ptr eptr) noexcept : eptr(std::move(eptr)) {}
91[[deprecated(
"Use co_await coroutine::return_exception_ptr or co_return coroutine::exception instead")]]
93inline exception make_exception(std::exception_ptr ex)
noexcept {
98[[deprecated(
"Use co_await coroutine::return_exception_ptr or co_return coroutine::exception instead")]]
100exception make_exception(T&& t)
noexcept {
101 log_exception_trace();
102 return exception(std::make_exception_ptr(std::forward<T>(t)));
126inline exception return_exception_ptr(std::exception_ptr ex)
noexcept {
127 return exception(std::move(ex));
142[[deprecated(
"Use co_await coroutine::return_exception_ptr instead")]]
144inline exception return_exception(std::exception_ptr ex)
noexcept {
145 return exception(std::move(ex));
150exception return_exception(T&& t)
noexcept {
151 log_exception_trace();
152 return exception(std::make_exception_ptr(std::forward<T>(t)));
157inline auto operator co_await(coroutine::exception ex)
noexcept {
158 return internal::exception_awaiter(std::move(ex.eptr));
promise - allows a future value to be made available at a later time.
Definition: future.hh:934
void set_exception(std::exception_ptr &&ex) noexcept
Marks the promise as failed.
Definition: future.hh:998
Seastar API namespace.
Definition: abort_on_ebadf.hh:26
Definition: exception.hh:71