You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error() function returns an optional<exception_ptr>. Wouldn't just a, possibly null, exception_ptr be sufficient? (I know we perhaps have two states here, ready, and an exception occurred, perhaps we can collapse that and add a ready() or status() member. The name is also a bit unexpected, I would expect it to be called exception() to match set_exception(). We could add exception() as a non-breaking change and deprecate error(). The current form makes writing recover() extra painful (see issue #263):
f.recover([](auto f) {
auto e = f.error();
if (e && *e) //...
}
compared to:
f.recover([](auto f) {
if (auto e = f.exception()) //...
}
The text was updated successfully, but these errors were encountered:
The
error()
function returns anoptional<exception_ptr>
. Wouldn't just a, possibly null,exception_ptr
be sufficient? (I know we perhaps have two states here, ready, and an exception occurred, perhaps we can collapse that and add aready()
orstatus()
member. The name is also a bit unexpected, I would expect it to be calledexception()
to matchset_exception()
. We could addexception()
as a non-breaking change and deprecateerror()
. The current form makes writing recover() extra painful (see issue #263):compared to:
The text was updated successfully, but these errors were encountered: