fmt::format_system_error

Formats an error message for an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out. The format is the same as the one used by std::system_error(ec, message) where ec is std::error_code(error_code, std::generic_category()). It is implementation-defined but normally looks like:

Synopsis

Declared in <fmt/format.h>

void
format_system_error(
    /* implementation-defined */& out,
    int error_code,
    char const* message) noexcept;

Description

<message>: <system-message>

where <message> is the passed message and <system-message> is the system message corresponding to the error code. error_code is a system error code as given by errno.

Parameters

NameDescription
outThe buffer to append the formatted message to.
error_codeA system error code as given by errno.
messageThe message describing the operation that failed.