-
Notifications
You must be signed in to change notification settings - Fork 51
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 errors
example demo file
#151
base: master
Are you sure you want to change the base?
Conversation
e2f33d7
to
0a03c11
Compare
Add an `errors` example that creates and prints various error types from the crate. This is useful for two main purposes: - Helps us catch mistakes by exercising error paths. - Helps us check that error output is useful for debugging. - Helps us check that output for "alloc" builds is good/useful (no-std) Run with appropriate features to verify the output, e.g., `cargo run --example errors --no-default-features --features=alloc`
0a03c11
to
61b6300
Compare
Hmm, concept ACK 61b6300. I think in practice this'd be pretty hard to keep in sync with the actual error types. Maybe it should be a collection of unit tests rather than examples? |
Its only about the "meaningfulness" of the error messages, I couldn't think of a way to test this except look at it every now and again. Once we are happy I don't think it will matter if some are missed, since devs will tend to copy the error style currently there. |
Ok, makes sense. After running the example all the error messages look great to me except that we should drop |
Sweet! Thanks for running them. |
Remove the 'code=' and just write the character in single quotes.
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.
ACK a321ee5
Do you want this to be merged? |
Maybe just leave it here and I'll have a go doing it in another repo, then see if it feels like its worth having. I'm not 100% sure it won't just sit and rot never to be touched again. |
Add an
errors
example that creates and prints various error types from the crate. This is useful for two main purposes:Run with appropriate features to verify the output, e.g.,
This example is prone to go stale, is it useful? I could not think of any other way to verify that our error output was good (in both std and no-std environments).