| Home | Libraries | People | FAQ | More

##### format_context_base::add_error

Adds an error to the current error state.

###### Synopsis

    void
    add_error(
        error_code ec) noexcept;

###### Description

This function can be used by custom formatters to report that they received a value that can't be formatted. For instance, it's used by the built-in string formatter when a string with an invalid encoding is supplied.

If the error state is not set before calling this function, the error state is updated to `ec`. Otherwise, the error is ignored. This implies that once the error state is set, it can't be reset.

###### Exception safety

No-throw guarantee.