GothicKit / ZenKit

A re-implementation of file formats used by the early 2000's ZenGin
http://zk.gothickit.dev/
MIT License
44 stars 10 forks source link

Improve error reporting #4

Closed lmichaelis closed 1 year ago

lmichaelis commented 2 years ago

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.