Add ticks around error messages more consistently (#3004)

## Summary

I found some of these too bare (e.g., when they _just_ show a package
name with no other information). For me, this makes it easier to
differentiate error message copy from data. But open to other opinions.
Take a look at the fixture changes and LMK!
This commit is contained in:
Charlie Marsh 2024-04-22 19:58:36 -04:00 committed by GitHub
parent 8536e63438
commit 14f05f27b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 59 additions and 59 deletions

View file

@ -17,7 +17,7 @@ pub enum Error {
NoBinary,
// Network error
#[error("Failed to parse URL: `{0}`")]
#[error("Failed to parse URL: {0}")]
Url(String, #[source] url::ParseError),
#[error(transparent)]
JoinRelativeUrl(#[from] pypi_types::JoinRelativeError),
@ -41,9 +41,9 @@ pub enum Error {
CacheEncode(#[from] rmp_serde::encode::Error),
// Build error
#[error("Failed to build: {0}")]
#[error("Failed to build: `{0}`")]
Build(String, #[source] anyhow::Error),
#[error("Failed to build editable: {0}")]
#[error("Failed to build editable: `{0}`")]
BuildEditable(String, #[source] anyhow::Error),
#[error("Built wheel has an invalid filename")]
WheelFilename(#[from] WheelFilenameError),
@ -90,7 +90,7 @@ pub enum Error {
#[error("Failed to hash distribution")]
HashExhaustion(#[source] std::io::Error),
#[error("Hash mismatch for {distribution}\n\nExpected:\n{expected}\n\nComputed:\n{actual}")]
#[error("Hash mismatch for `{distribution}`\n\nExpected:\n{expected}\n\nComputed:\n{actual}")]
MismatchedHashes {
distribution: String,
expected: String,
@ -98,26 +98,26 @@ pub enum Error {
},
#[error(
"Hash-checking is enabled, but no hashes were provided or computed for: {distribution}"
"Hash-checking is enabled, but no hashes were provided or computed for: `{distribution}`"
)]
MissingHashes { distribution: String },
#[error("Hash-checking is enabled, but no hashes were computed for: {distribution}\n\nExpected:\n{expected}")]
#[error("Hash-checking is enabled, but no hashes were computed for: `{distribution}`\n\nExpected:\n{expected}")]
MissingActualHashes {
distribution: String,
expected: String,
},
#[error("Hash-checking is enabled, but no hashes were provided for: {distribution}\n\nComputed:\n{actual}")]
#[error("Hash-checking is enabled, but no hashes were provided for: `{distribution}`\n\nComputed:\n{actual}")]
MissingExpectedHashes {
distribution: String,
actual: String,
},
#[error("Hash-checking is not supported for local directories: {0}")]
#[error("Hash-checking is not supported for local directories: `{0}`")]
HashesNotSupportedSourceTree(String),
#[error("Hash-checking is not supported for Git repositories: {0}")]
#[error("Hash-checking is not supported for Git repositories: `{0}`")]
HashesNotSupportedGit(String),
}