Skip to content

Commit 24cc3da

Browse files
committed
Implement std::error::Error trait for webpki::Error
* Implement `std::fmt::Debug` for `webpki::Error` * Implement `std::fmt::Display` for `webpki::Error` * Implement `std::error::Error` for `webpki::Error`
1 parent 398ead6 commit 24cc3da

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ impl std::fmt::Display for WebPkiError {
3636

3737
impl std::error::Error for WebPkiError {}
3838

39+
impl std::fmt::Debug for webpki::Error {
40+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
41+
write!(f, "{:?}", self)
42+
}
43+
}
44+
45+
impl std::fmt::Display for webpki::Error {
46+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
47+
write!(f, "{}", self)
48+
}
49+
}
50+
51+
impl std::error::Error for webpki::Error {}
52+
3953
#[tokio::main]
4054
async fn main() -> Result<(), Box<dyn std::error::Error>> {
4155
let app_matches = parse_command_line();

0 commit comments

Comments
 (0)