You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example for custom formatter specifies that in case of format parse error, one should call ctx.on_error("invalid format"). But this method got removed in d174508 and the impl uses detail::throw_format_error, which should not be used from outsude.
What is the recommended way to report parse errors now?
Works in 9.1.0. Broken in 10.0.0. Still fails on master.
I worked this around by defining my own throw_format_error function and using that, but I think the lib should expose such a function. One can just throw format_error(...) directly, but then including <fmt/core.h> is not enough (and including <fmt/format.h> in a header is too heavy).
The example is still wrong, though, as now including <fmt/core.h> is not enough. We could change the include in just the one example (as the rest doesn't need <fmt/format.h>).
But IMO having the throwing function available directly from the library (and having the includes consistent) would be less confusing.
I can create a PR with whatever variant you want to use if you want.
A PR to expose throw_format_error via the public API is welcome but note that for ABI compatibility reasons it should be done via an alias rather than moving the function to another namespace.
The example for custom formatter specifies that in case of format parse error, one should call
ctx.on_error("invalid format")
. But this method got removed in d174508 and the impl usesdetail::throw_format_error
, which should not be used from outsude.What is the recommended way to report parse errors now?
Works in 9.1.0. Broken in 10.0.0. Still fails on master.
godbolt link: https://godbolt.org/z/dEWEKEsTc
The text was updated successfully, but these errors were encountered: