folly::make_coded_rich_error

make_coded_rich_error overloads

Synopses

Declared in <folly/result/coded_rich_error.h>

Builds an error from a message and multiple codes.

template<typename... Codes>
constexpr
rich_error<ErrorT<Codes...>>
make_coded_rich_error(
    rich_msg msg,
    ExtraArgs... extra_args,
    Codes... codes);
» more...

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

template<
    typename Code,
    typename... As>
constexpr
rich_error<ErrorT<Code>>
make_coded_rich_error(
    Code code,
    ExtraArgs... extra_args,
    ext::format_string_and_location<As...> snl = "",
    As const&... args);
» more...

Return Value

  • A rich_error<ErrorT<Codes...>> holding the codes and message.
  • A rich_error<ErrorT> holding the code and message.

Parameters

NameDescription
msgThe rich message.
extra_argsExtra required arguments between the message and codes.
codesThe error codes.
codeThe single error code.
snlThe format string and source location.
argsFormat arguments for the message.