diff --git a/doc/api.rst b/doc/api.rst index c593b13f0f26..5f55a97893b0 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -155,7 +155,7 @@ For example:: if (it != end && (*it == 'f' || *it == 'e')) presentation = *it++; // Check if reached the end of the range: - if (it != end && *it != '}') ctx.on_error("invalid format"); + if (it != end && *it != '}') FMT_THROW(format_error("invalid format")); // Return an iterator past the end of the parsed range: return it;