pub use aether_data_contracts::DataLayerError; #[cfg(feature = "postgres")] pub(crate) fn postgres_error(error: impl std::fmt::Display) -> DataLayerError { DataLayerError::postgres(error) } pub(crate) fn sql_error(error: impl std::fmt::Display) -> DataLayerError { DataLayerError::sql(error) } #[cfg(feature = "postgres")] pub(crate) trait SqlxResultExt { fn map_postgres_err(self) -> Result; } #[cfg(feature = "postgres")] impl SqlxResultExt for Result { fn map_postgres_err(self) -> Result { self.map_err(postgres_error) } } pub(crate) trait SqlResultExt { fn map_sql_err(self) -> Result; } impl SqlResultExt for Result { fn map_sql_err(self) -> Result { self.map_err(sql_error) } }