Skip to content

Consider rewording the error message #35

Description

@schneiderfelipe

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."?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions