1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-30 12:00:38 +00:00

Add minimal std::error::Error impl for Error

This commit is contained in:
Nikolay Kim 2019-04-04 13:23:38 -07:00
parent d8bc66a18e
commit 1f5c0f50f9
2 changed files with 18 additions and 0 deletions

View file

@ -2,6 +2,10 @@
## [0.1.0-alpha.4] - 2019-04-xx ## [0.1.0-alpha.4] - 2019-04-xx
### Added
* Add minimal `std::error::Error` impl for `Error`
### Changed ### Changed
* Export IntoHeaderValue * Export IntoHeaderValue

View file

@ -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 /// Convert `Error` to a `Response` instance
impl From<Error> for Response { impl From<Error> for Response {
fn from(err: Error) -> Self { fn from(err: Error) -> Self {