From 86291f1eb5544dc5c9f1429d814e8edd4e936229 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Sat, 27 Jun 2026 17:06:02 -0400 Subject: [PATCH] Convert deadpool::PoolError into Database error --- src/util/error.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/util/error.rs b/src/util/error.rs index 504c7d6..6de8ff7 100644 --- a/src/util/error.rs +++ b/src/util/error.rs @@ -314,6 +314,16 @@ impl From for Error { } } +// This would capture any `deapool::PoolError` and treat it as a database error +// but we're only using `deadpool` for our database, so it's fine +#[cfg(feature = "server")] +impl From for Error { + #[track_caller] + fn from(err: diesel_async::pooled_connection::deadpool::PoolError) -> Self { + Error::new_here(ErrorType::Database(format!("{err}"))) + } +} + #[cfg(feature = "server")] impl From for Error { #[track_caller]