-
Notifications
You must be signed in to change notification settings - Fork 103
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
Turn procfs into a panic-free library #44
Comments
eminence
added a commit
that referenced
this issue
Oct 14, 2019
The `ProcError` error type now gains a new `InternalError` variant which is designed to cover cases when the procfs library encounters something unexpected and would otherwise panic. Every instance of `InternalError` should be considered a bug that should be reported Closes #44
I have a WIP pull request that implements this. If you're interested in getting a peek at the code, please feel free to take a look. I hope to have a new version published on crates.io within 1 or 2 weeks. Please note that this will be a breaking change, so the new version number will be |
Thanks! I'll have a look sometime this week! Cheers! |
eminence
added a commit
that referenced
this issue
Oct 18, 2019
The `ProcError` error type now gains a new `InternalError` variant which is designed to cover cases when the procfs library encounters something unexpected and would otherwise panic. Every instance of `InternalError` should be considered a bug that should be reported Closes #44
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the current design of the procfs crate, panics were possible, as assertions and unwraps are common in the code. This was done to help uncover bugs in the library.
As the library has matured a bit, all of the assertions and unwraps should be replaced with
Result
types. Most functions already return aProcResult
, so this itself isn't a big change to the public API of procfs.See also #39
The text was updated successfully, but these errors were encountered: