Skip to content
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

Add more descriptive errors to test_linear_device #586

Conversation

jsalzbergedu
Copy link

More descriptive errors on test_linear_device. Please let me know if this is a bad idea or if I can do anything to make it better.

@trgill
Copy link
Contributor

trgill commented Oct 1, 2017

Can one of the admins verify this patch?

Note: This is just a Jenkins auto-message.

@mulkieran
Copy link
Member

mulkieran commented Oct 2, 2017

Thanks for the patch!

We have a rule, perhaps not yet in our style guide, the we use expect only for unwraps() that we believe that we can prove logically will always succeed. There are some transgressions in our code base, but they're becoming fewer.

An odd drawback of expects() is, that while you may gain an explanation you can lose other information, see discussion: rust-lang/rust-clippy#1921.

What we're working on, which we hope will help, is adding the use of the error_chain module to both devicemapper and stratisd. Here's the PR in devicemapper: stratis-storage/devicemapper-rs#163. Then, when an unwrap fails, you'll be able to view the error, as now, the stack trace associated w/ that error, the error that caused the error that your viewing, the stack trace associated with that error, and so on.

@mulkieran mulkieran closed this Oct 2, 2017
mulkieran added a commit that referenced this pull request Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants