diff --git a/include/ircd/ctx/future.h b/include/ircd/ctx/future.h index 263a22c8b..8d031c161 100644 --- a/include/ircd/ctx/future.h +++ b/include/ircd/ctx/future.h @@ -46,6 +46,8 @@ struct ircd::ctx::future bool valid() const { return !is(state(), future_state::INVALID); } bool operator!() const { return !valid(); } + std::exception_ptr eptr() const { return state().eptr; } + string_view what() const { return util::what(eptr()); } explicit operator T() { return get(); } template friend bool wait_until(const future &, const time_point &, std::nothrow_t); @@ -75,6 +77,8 @@ struct ircd::ctx::future bool valid() const { return !is(state(), future_state::INVALID); } bool operator!() const { return !valid(); } + std::exception_ptr eptr() const { return state().eptr; } + string_view what() const { return util::what(eptr()); } template friend bool wait_until(const future &, const time_point &, std::nothrow_t); template friend void wait_until(const future &, const time_point &);