diff --git a/src/routes/subscriptions.rs b/src/routes/subscriptions.rs index d2d9bb9..2d882be 100644 --- a/src/routes/subscriptions.rs +++ b/src/routes/subscriptions.rs @@ -154,6 +154,8 @@ pub async fn store_token( Ok(()) } +#[derive(thiserror::Error)] +#[error("A database error was encountered while trying to store a subscription token.")] pub struct StoreTokenError(sqlx::Error); impl std::fmt::Debug for StoreTokenError { @@ -162,22 +164,6 @@ impl std::fmt::Debug for StoreTokenError { } } -impl std::fmt::Display for StoreTokenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "A database error was encountered while \ - trying to store a subscription token." - ) - } -} - -impl std::error::Error for StoreTokenError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - Some(&self.0) - } -} - fn error_chain_fmt( e: &impl std::error::Error, f: &mut std::fmt::Formatter<'_>,