folly::rich_error_base

Base class for exceptions that carry a queryable rich error code.

Synopsis

Declared in <folly/result/rich_error_base.h>

class rich_error_base;

Types

NameDescription
fmt_all_codes_t A fmt-formattable view of all codes in this error's hierarchy.
underlying_error_private_t Passkey granting folly-internal access to the underlying-error pointer.

Member Functions

NameDescription
~rich_error_base [destructor] [virtual]Virtual destructor.
all_codes_for_fmt Returns a fmt-formattable view of all codes in this error's hierarchy.
format_to [virtual]Renders this error for fmt and ostream<<.
format_with_epitaphs Formats this epitaph stack, starting with its underlying error.
format_with_epitaphs_without_first_underlying Formats only the epitaph stack, omitting the first underlying error.
mutable_underlying_error Returns mutable access to the underlying error pointer (folly-internal).
next_error_for_epitaph [virtual]Returns the next error in the epitaph/nesting chain, if any.
partial_message [virtual]Returns a partial message for this error (prefer <</fmt for logging).
retrieve_code [virtual]Override to support RTTI-free get_rich_error_code().
source_location [virtual]Returns the source location where this error was created.
underlying_error Returns the error that is actually propagating (the "underlying" error).

Protected Member Functions

NameDescription
rich_error_base [constructor]Constructors
operator= Assignment operators
set_underlying_error Sets the underlying error pointer (only used by epitaph_non_value).

Friends

NameDescription
folly::rich_errorA rich error carrying a user-defined base type and a formatted message.

Derived Classes

NameDescription
coded_rich_error Start with the user docs in docs/rich_error_code.md.