From 1f5c0f50f9092f3b19f4c2b4c3f25111e0861e55 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 4 Apr 2019 13:23:38 -0700 Subject: [PATCH] Add minimal std::error::Error impl for Error --- actix-http/CHANGES.md | 4 ++++ actix-http/src/error.rs | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 106c57f38..25439604f 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,6 +2,10 @@ ## [0.1.0-alpha.4] - 2019-04-xx +### Added + +* Add minimal `std::error::Error` impl for `Error` + ### Changed * Export IntoHeaderValue diff --git a/actix-http/src/error.rs b/actix-http/src/error.rs index 6098421a8..3e0076b49 100644 --- a/actix-http/src/error.rs +++ b/actix-http/src/error.rs @@ -71,6 +71,20 @@ impl fmt::Debug for Error { } } +impl std::error::Error for Error { + fn description(&self) -> &str { + "actix-http::Error" + } + + fn cause(&self) -> Option<&dyn std::error::Error> { + None + } + + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + None + } +} + /// Convert `Error` to a `Response` instance impl From for Response { fn from(err: Error) -> Self {