A rich error carrying a user‐defined base type and a formatted message.

Synopsis

Declared in <folly/result/rich_error.h>

template<typename UserBase>
class [[nodiscard]] rich_error final
    : public /* implementation-defined */
    , public std::exception

Description

See docs/rich_error.md.

Base Classes

Name

Description

/* implementation-defined */

std::exception

Type Aliases

Name

Description

folly_detail_base_of_rich_error

The user‐defined base type this rich error was built from.

folly_get_exception_hint_types

The exception‐hint type list used by folly::get_exception.

Member Functions

Name

Description

rich_error [constructor]

Constructs an empty rich error.

rich_error [constructor]

Constructs a rich error from an immortal base instance.

rich_error [constructor]

Constructs a rich error by forwarding arguments to the user base.

operator=

what [virtual]

Returns the error message.

Non-Member Functions

Name

Description

make_coded_rich_error

Builds an error from a message and multiple codes.

make_coded_rich_error

Builds an error from a single code and a format message.

make_inheriting_coded_rich_error

Builds an error from a single code and a format message.

make_inheriting_coded_rich_error

Builds an error from a message and multiple codes.

make_nestable_coded_rich_error

Builds an error from a single code and a format message.

make_nestable_coded_rich_error

Builds an error from a message and multiple codes.

Return Value

Note

The return value should not be discarded.

Created with MrDocs