-
Notifications
You must be signed in to change notification settings - Fork 19
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
Improve error handling #16
Comments
Interested |
Just a personal recommendation - I really like using the |
I haven't used error_chain before, but looks nice! @soumya-ranjan7 enum LoadingError {
FontNotPresent,
Platform(Error)
} Like @ashkitten suggested, you can use the The unwraps in win32 like this one should be converted into an If you have questions, post them here :) |
I will be working on Windows @MSleepyPanda |
Isn't it better as a library especially to bubble the errors up by returning Result? That way any application using the library can deal with errors however it wants, without having to panic if something goes wrong. Generally, panicking in a library is a bad thing to do. |
In general, i agree. But when the OS is returning non null terminated or non utf8 strings, we have a bigger problem than the library panicking. At some point, we have to trust the OS i think. (Fight me :P ) |
There are a lot of
unwrap()
s in the code. Proper error handling with Result's would be nice.Happy to provide guidance! Just comment on this issue.
Edit:
The text was updated successfully, but these errors were encountered: