-
Notifications
You must be signed in to change notification settings - Fork 30
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
Use error-chain library #163
Conversation
baa34ff
to
a052702
Compare
d0a68c1
to
3f650bd
Compare
See Stratis usage at: stratis-storage/stratisd#564. Edit: That pull no longer contains the changes. I'll be doing another pull tomorrow. |
11a6697
to
0bdb2a8
Compare
7eacb53
to
34fe428
Compare
How about renaming |
I think that would be an unusual thing to do. even the standard library has |
This isn't how we're doing it right now, either here or in stratisd. It would be best to introduce error chain in this PR without tying it to the larger style issue of how we name our result types, please. |
b22032a
to
e692c7b
Compare
@agrover @trgill Here's an example backtrace that we get from an unwrap() when the error is an error-chain error and BACKTRACE=1. https://travis-ci.org/stratis-storage/devicemapper-rs/jobs/277303412. Note that it contains the full backtrace of the actual error, although there is also a lot of other probably unavoidable stuff mixed in with it. |
8d9145b
to
51a242c
Compare
Taking advantage of #171 . |
51a242c
to
8e18e16
Compare
rebased. |
3bd4e47
to
e3afab7
Compare
For code reuse, clarity, uniformity with device creation. Signed-off-by: mulhern <amulhern@redhat.com>
To gain the benefits of the library. * Add a new errors.rs file to contain the macro invocations for error_chain. * Remove result.rs file, now obsoleted. * Substitute as appropriate. * Add some error chains to handle higher level errors. Signed-off-by: mulhern <amulhern@redhat.com>
When summarizing the meaning of failures, gather up the first error and then chain. Signed-off-by: mulhern <amulhern@redhat.com>
There's a little less obvious function origami and the code is slightly easier to read. Signed-off-by: mulhern <amulhern@redhat.com>
This makes the tests a bit more precise. Signed-off-by: mulhern <amulhern@redhat.com>
One is for devicemapper core and one is for the outer layer. Signed-off-by: mulhern <amulhern@redhat.com>
Signed-off-by: mulhern <amulhern@redhat.com>
e3afab7
to
11a0a88
Compare
rebased. |
@mulkieran this PR appears to be obsoleted, if so please close? |
It needs to be broken out into issues. |
Likely we will be using faillure crate instead of error-chain, so probably this PR is no longer useful. |
Signed-off-by: mulhern amulhern@redhat.com