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 {