Wrapper for propagating an exception directly rather than throwing it. The wrapper can be used with both co_await and co_return.
- Note
- It is not possible to co_return the wrapper in coroutines which return future<> due to language limitations (it's not possible to specify both return_value and return_void in the promise_type). You can use co_await instead which works in coroutines which return either future<> or future<T>.
Example usage:
co_await coroutine::exception(std::make_exception_ptr(std::runtime_error(
"something failed miserably")));
co_return coroutine::exception(std::make_exception_ptr(std::runtime_error(
"something failed miserably")));
Definition: exception.hh:71
#include <seastar/coroutine/exception.hh>
|
| exception (std::exception_ptr eptr) noexcept |
|
The documentation for this struct was generated from the following file: