Implements proper user error handling #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We delineate between user errors and program errors.
Any user error should effectively cascade up to where it's relevant.
We don't want it crashing the program or anything like that either.
What I've done here is expand on the existing use of the UFE library (user facing errors) which gives us nice rendering and the ability to trivially define errors, the reason for them, and how you might fix them.
We combined this with the macro based error library to make easy to use errors for devs with in theory meaningful output for users.
There's a lot of stuff that should error that just doesn't (configs) but I think this is a lot better then how things were before.
There are a few issues, mostly with converting out of crate errors into this system.
It's less a matter of being impossible and more I don't have the kahones to setup hints for every single type on both input and
output failures. So we just let them speak for themselves.
Anyhow tool should crash less and report more now, which is pog.
Oh also I've pulled in owo-colors to make the terminal output a bit more pretty.