mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-23 00:24:17 +02:00
Impl Display for TealdeerError
This commit is contained in:
parent
e2d61e3ef2
commit
6fcb1e17de
1 changed files with 11 additions and 0 deletions
11
src/error.rs
11
src/error.rs
|
|
@ -1,3 +1,4 @@
|
|||
use std::fmt;
|
||||
use curl::Error as CurlError;
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -12,3 +13,13 @@ impl From<CurlError> for TealdeerError {
|
|||
TealdeerError::UpdateError(format!("Curl error: {}", err.to_string()))
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for TealdeerError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
TealdeerError::CacheError(e) => write!(f, "CacheError: {}", e),
|
||||
TealdeerError::ConfigError(e) => write!(f, "ConfigError: {}", e),
|
||||
TealdeerError::UpdateError(e) => write!(f, "UpdateError: {}", e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue