Holds an error (std::exception_ptr) or a "stopped"/cancellation state.
Declared in <folly/result/result.h>
class [[nodiscard]] error_or_stopped;
| Name | Description |
|---|---|
error_or_stopped [constructor] | Constructors |
operator= | Assigns the "stopped"/cancellation state. |
format_to | Implementation of fmt::format and operator<<(ostream&). |
get_exception | Implements the folly::get_exception<Ex>(res) protocol. |
get_legacy_error_or_cancellation_slow | Extracts the stored error as a legacy exception_wrapper. |
get_mutable_exception | Implements the mutable folly::get_mutable_exception<Ex>(res) protocol. |
has_stopped | Tests whether this holds the "stopped"/cancellation state. |
release_rich_exception_ptr | Moves out the internal rich_exception_ptr, leaving *this moved-from. |
throw_exception [noreturn] | Rethrows the stored error. AVOID: throwing costs upwards of 1usec. |
to_exception_ptr_slow | AVOID. Use folly::get_exception<Ex>(r) to check for specific exceptions. It may be OK to add more specific accessors to error_or_stopped, see throw_exception() for an example. |
| Name | Description |
|---|---|
from_current_exception | AVOID. Most code should use result coros, which catch most exceptions automatically. Or, for a stronger guarantee, see result_catch_all. |
from_exception_ptr_slow | AVOID. Use error_or_stopped(YourException{...}) if at all possible. Add a std::in_place_type_t<Ex> constructor if needed. |
make_legacy_error_or_cancellation_slow | Wraps a legacy exception_wrapper (possibly cancellation) as an error_or_stopped. |
| Name | Description |
|---|---|
folly::operator== | Compares two error_or_stopped values for equality. |
folly::result | A value, an error (std::exception_ptr), or a "stopped"/cancellation state. |
| Name | Description |
|---|---|
epitaph | epitaph |
or_unwind_epitaph | Syntax sugar for or_unwind(epitaph(...)) on an error-or-stopped value. |
stack_epitaph | stack_epitaph |
The return value should not be discarded.