folly::error_or_stopped::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.

Synopsis

Declared in <folly/result/result.h>

static
error_or_stopped
from_exception_ptr_slow(std::exception_ptr eptr);

Description

Provided for compatibility with existing code. It has several downsides for result-first code:

  • It is a debug-fatal invariant violation to pass in an exception_ptr that is empty or has OperationCancelled. See the dfatal_if_eptr_empty_or_stopped doc.

  • Not knowing the static exception type blocks optimizations that can otherwise help avoid RTTI on error paths.

Return Value

An error_or_stopped holding eptr.

Parameters

NameDescription
eptrThe exception pointer to wrap (must be non-empty, non-stopped).