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
Remove unwrap()'s #61
Comments
Yeah, that'd be a good effort. |
Just one quick question, do you mind having an enum with all miniserve's error kind, or do you want them to be split like right now, aka PS: there might be a third solution, that would allow to have separate enums, but only 1 implementation, but sadly I can't figure out how... |
Ok so honestly I'm thinking hard about both ways and I think I'm entirely balanced concerning my opinion on the matter. For one, it seems nice to have separate errors for separate parts of the application but then again we might also run into scenarios where an error fits into neither category and that'd be awkward. Cutting down on boilerplate is always nice, of course. I'll let you make the call on this. |
The argument about an error fitting into no/several categories is very true, didn't think about that. This will probably be the case with |
Well, if that's your only problem you have with miniserve I'd say we did
pretty well. :D
…On Thu, Apr 18, 2019, 17:43 mglax ***@***.***> wrote:
Good, that's the only complain I have about miniserve.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAANAF2VJVYSX5Y5IJ2FA3PRCJJJANCNFSM4HEJJEPA>
.
|
Glad to hear you like it! |
Leaving this open until the very last |
We have some places in the code where we call unwrap() (4 to be precise).
Maybe we could replace those with unwrap_or* (default value, actual error, etc, depending on the case) for unwrap()'s happening outside the main() method, and as for the ones happening in the main(), printing a nice error message with the logger + exiting instead of panicking.
This has been suggested in Reddit's "what's everyone working on this week": https://www.reddit.com/r/rust/comments/bapows/whats_everyone_working_on_this_week_152019/ekdt4ls
The text was updated successfully, but these errors were encountered: