At the moment, phoenix only reports some failures using custom exception classes. Ideally, any failure which needs to be reported to the user should be wrapped in a custom exception class.
There is also a discussion to be had about using exceptions at all. It might be better to report failures using std::optional or a custom std::expected structure than throwing exceptions since some codebases don't allow exceptions at all.
Since this is a parser library, failure can occur more often than usual thus performance is also a point to keep in mind when using exceptions to report parsing failures.
At the moment, phoenix only reports some failures using custom exception classes. Ideally, any failure which needs to be reported to the user should be wrapped in a custom exception class.
There is also a discussion to be had about using exceptions at all. It might be better to report failures using
std::optional
or a customstd::expected
structure than throwing exceptions since some codebases don't allow exceptions at all.Since this is a parser library, failure can occur more often than usual thus performance is also a point to keep in mind when using exceptions to report parsing failures.