Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Consider rewording the error message #35

Open
schneiderfelipe opened this issue Jul 20, 2024 · 0 comments
Open

Consider rewording the error message #35

schneiderfelipe opened this issue Jul 20, 2024 · 0 comments

Comments

@schneiderfelipe
Copy link

TL;DR: an error message starting with a lowercase letter and lacking a period at the end might "compose" better.


Currently, the error message reads

vec1/src/lib.rs

Line 156 in bc8e2ce

fter.write_str("Cannot produce a Vec1 with a length of zero.")

which begins with an uppercase letter and ends with a period.

This makes the following pattern "weird" (this is a synthetic example, but you get the idea)

use std::io;

use thiserror::Error;
use vec1;

#[derive(Error, Debug)]
pub enum SpamError {
    #[error("could not produce spam: {0}")]
    Size0(#[from] vec1::Size0Error),
    #[error("could not read or write spam: {0}")]
    Io(#[from] io::Error),
    // ...
}

In fact, this already happens with serde in some way (e.g., "Cannot produce a Vec1 with a length of zero. at line 1 column 2"; notice the period in the middle of the error message).

So, could the error message read "cannot produce a Vec1 with a length of zero" instead of "Cannot produce a Vec1 with a length of zero."?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant