Improve fmt::Display impl for all Error types (#781)

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-02-10 14:01:22 +11:00 committed by GitHub
parent 9d9b72c768
commit d9dd611b9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 17 deletions

View file

@ -79,7 +79,7 @@ pub enum BinstallError {
///
/// - Code: `binstall::url_parse`
/// - Exit: 65
#[error(transparent)]
#[error("Failed to parse url: {0}")]
#[diagnostic(severity(error), code(binstall::url_parse))]
UrlParse(#[from] url::ParseError),
@ -87,7 +87,7 @@ pub enum BinstallError {
///
/// - Code: `binstall::unzip`
/// - Exit: 66
#[error(transparent)]
#[error("Failed to extract zipfile: {0}")]
#[diagnostic(severity(error), code(binstall::unzip))]
Unzip(#[from] ZipError),
@ -95,7 +95,7 @@ pub enum BinstallError {
///
/// - Code: `binstall::template`
/// - Exit: 67
#[error(transparent)]
#[error("Failed to render template: {0}")]
#[diagnostic(severity(error), code(binstall::template))]
Template(Box<TinyTemplateError>),
@ -105,7 +105,7 @@ pub enum BinstallError {
///
/// - Code: `binstall::reqwest`
/// - Exit: 68
#[error(transparent)]
#[error("Reqwest error: {0}")]
#[diagnostic(severity(error), code(binstall::reqwest))]
Reqwest(#[from] ReqwestError),
@ -137,7 +137,7 @@ pub enum BinstallError {
///
/// - Code: `binstall::io`
/// - Exit: 74
#[error(transparent)]
#[error("I/O Error: {0}")]
#[diagnostic(severity(error), code(binstall::io))]
Io(io::Error),
@ -171,7 +171,7 @@ pub enum BinstallError {
///
/// - Code: `binstall::cargo_manifest`
/// - Exit: 78
#[error(transparent)]
#[error("Failed to parse cargo manifest: {0}")]
#[diagnostic(
severity(error),
code(binstall::cargo_manifest),