-
Notifications
You must be signed in to change notification settings - Fork 10
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
Better error handling #4
Comments
Fully agree :) Thanks for working on this. |
+1 If I can find some time in the next couple months I would be happy to help with this as well. |
I think @ijks already pushed some of his changes here: https://github.com/ijks/ears/tree/better-error-handling Looking forward to it! :) |
Thanks for the link! I'll see if I can coordinate with him :) |
So this fell a bit by the wayside. 😅 I think what I had so far was pretty much done, or at least covered all cases where functions used to panic. So I could just open a PR? It's all |
Yes, just open a PR :) |
Right now, a lot of errors are returned using
Option
. I think it's more idiomatic and user friendly if errors are returned usingResult
, because then consumers of this library can use the error information to do their own error reporting, or handle an error gracefully. Currently the code handling errors just does hardcodedprintln!
s, which is only unwanted output IMO, and causes information loss. It should be pretty simple to change uses ofOption<T>
toResult<T, &str>
or something similar, and I'm willing to make a pull request for it.The text was updated successfully, but these errors were encountered: