-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: error handling #48
Conversation
for more information, see https://pre-commit.ci
This is ready for review now with #26 being merged |
@oskardotglobal seems like something messed up with your repo, because it for example readds the quickemu installer script. |
Yeah, gotta merge first |
Ok, this is fully up-to-date now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor code parts did get lost, otherwise great work.
Ok I've made some more changes; I've fully removed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost finished.
there we go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now ready.
All those
.expect
s and nested match statements were bugging me, so I've written a custom error handler.Basically, I've written 2 macros, which do the following:
unwrap_or_panic!
&unwrap_or_exit!
- Unwrap either an Option or a Result. Log the error of the result if it exists + further context withformat!
syntax supporterror!
&error_from!
- Construct aWinappsError
from an existing error and / or a message. This is mostly used to return values from functions, but you can still callpanic
andexit
on it for the functionality of the 2 macros aboveI've also documented all of them and all the structs, enums and traits I used.
This also includes the commits from #26, so that has to be merged first.