-
Notifications
You must be signed in to change notification settings - Fork 211
Revise error types and codes #11
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
Conversation
Versions found by examining API or trial-and-error. CI will now try minimal lib versions with minimal rustc version, but only for select targets.
Option isn't compatible with stable Rustc. Nightly runners already have important tests for latest version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me! Though I think we do not need error
module and we can re-export Error
type to the crate root.
Also looks there is a typo in Error::code
docs:
This may equal one of the codes defined in this library or may be a system error code.
Fix to "this may be equal to one of <..>"? Also shouldn't "it" or "the return code" be used here instead of "this"?
// A randomly-chosen 16-bit prefix for our codes | ||
pub(crate) const CODE_PREFIX: u32 = 0x57f40000; | ||
const CODE_UNKNOWN: u32 = CODE_PREFIX | 0; | ||
const CODE_UNAVAILABLE: u32 = CODE_PREFIX | 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should make UNKNOWN
and UNAVAILABLE
associated constants of Error
type?
We also don't need the |
I think a better analogy will be |
And yet |
BTW maybe it's worth to add |
Sorry, I meant |
Okay. I added the mentioned logging. What do you think about this? Many of the messages are not hugely useful, but this feature is optional and it's still not much overhead. |
No objections, though I am also not sure about usefulness, as you either get a panic, or process error explicitly. |
Agreed. Still, I don't wish to spend the time on trivial tweaks now so this will do (once I fix tests). |
FYI, libc version bumped to solve this error. I lack motivation to find the minimal version required. |
I can prepare a PR with some minor tweaks after you'll merge this one. |
Please do. |
This makes a few changes:
error
module publicIt feels quite clunky having to add an empty
fn error_msg_inner
to all modules, but I don't see a better approach.@newpavlov review? I think this concludes all my to-do list for the first release.
BTW the
dummy
module was broken; we don't appear to have a test for it (I hackedlib.rs
locally).