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:
parent
d8bc66a18e
commit
1f5c0f50f9
2 changed files with 18 additions and 0 deletions
|
@ -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
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue