-
Notifications
You must be signed in to change notification settings - Fork 4
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
Collected feedback #11
Comments
From #10: need to better explain the error conversions in the error type design chapter |
From Twitter: |
From Twitter: more examples (pointing at public repos), concrete examples of what the libs in the ecosystem chapter do. |
From Reddit: |
From Teams: The error variant might increase the size of return types, affecting perf. Consider size of error types and/or Box it. Add a sentence of explanation about try blocks to explain why all three ?s are necessary Verifiers can detect panics, e.g., Prusti, Kani More 'convenience links' for crates, etc. Link to Joe Duffy's blog post on the error model. Emphasis on recoverable errors vs program bugs earlier on, i.e., don't present panicking as an option for error handling. |
And from Zulip: add a case study on designing an error hierarchy, specifically discourage the single, monster enum anti-pattern. Could probably improve the description of Check for any mentions of |
Mention Snafu crate And continuing the discussion on designing error hierarchy: "SNAFU has long recommended making one per module with a throw-away line of "or more" and I've been mulling more aggressively recommending more." "I've been phrasing it as "you should have an error type for each domain/responsibility in your code", purposefully avoiding saying "module". and that if you have lots of _ => unreachable!() branches that's a sign you should split up errors. Which seems to click for people." "As an extreme example, I have a library that works with FFI using C-style return codes. The underlying library reuses the same set of ~15 codes for all possible methods, but each code can have a different implication for each method (e.g. ERR_BUSY might mean the receiver hasn't gotten ready post-creation in one case, while in another it means the receiver is already doing something). So I actually have an enum for each method (roughly) with the relevant error codes for that method plus a better contextual description of what they mean in the Display impl." |
I'm using this issue to collect feedback from various places after initial publication
The text was updated successfully, but these errors were encountered: