diff --git a/Cargo.toml b/Cargo.toml index a617c73..653345c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ keywords = ["error", "result"] askama = { version = "0.12", optional = true } log = { version = "0.4", features = ["std"], optional = true } serde_json = { version = "1.0", optional = true } +tokio-postgres = { version = "0.7", optional = true} ureq = { version = "2.6", optional = true } [features] diff --git a/src/lib.rs b/src/lib.rs index a1f7b80..c79e102 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,6 +90,13 @@ impl From for Rear { } } +#[cfg(feature = "tokio_postgres")] +impl From for Rear { + fn from(error: tokio_postgres::Error) -> Self { + Self { message: error.to_string(), error: error.into() } + } +} + #[cfg(feature = "ureq")] impl From for Rear { fn from(error: ureq::Error) -> Self {