-
-
Notifications
You must be signed in to change notification settings - Fork 205
Upper or lower case error messages? #209
Copy link
Copy link
Open
Description
I've noticed that all examples at https://docs.rs/anyhow/latest/anyhow/ use upper case error messages. This feels a bit odd, as I think the stdlib practice is to use lowercase error messages. There's also inconsistency with thiserror examples:
// anyhow repo:
#[derive(Error, Debug)]
pub enum FormatError {
#[error("Invalid header (expected {expected:?}, got {found:?})")]
InvalidHeader {
expected: String,
found: String,
},
#[error("Missing attribute: {0}")]
MissingAttribute(String),
}
// thiserror repo:
#[derive(Error, Debug)]
pub enum DataStoreError {
#[error("data store disconnected")]
Disconnect(#[from] io::Error),
#[error("the data for key `{0}` is not available")]
Redaction(String),
#[error("invalid header (expected {expected:?}, found {found:?})")]
InvalidHeader {
expected: String,
found: String,
},
#[error("unknown data store error")]
Unknown,
}Would it be a good idea to send a PR changing anyhow examples to lowercase?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels