diff --git a/scylla-cql/src/types/deserialize/mod.rs b/scylla-cql/src/types/deserialize/mod.rs index acdd50c7a..c5f3ed293 100644 --- a/scylla-cql/src/types/deserialize/mod.rs +++ b/scylla-cql/src/types/deserialize/mod.rs @@ -202,7 +202,6 @@ use thiserror::Error; /// It won't be returned by the `Session` directly, but it might be nested /// in the [`row::BuiltinTypeCheckError`]. #[derive(Debug, Clone, Error)] -#[error(transparent)] pub struct TypeCheckError(pub(crate) Arc); impl TypeCheckError { @@ -218,6 +217,12 @@ impl TypeCheckError { } } +impl Display for TypeCheckError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "TypeCheckError: {}", self.0) + } +} + /// An error indicating that a failure happened during deserialization. /// /// The error is type-erased so that the crate users can define their own diff --git a/scylla/src/transport/errors.rs b/scylla/src/transport/errors.rs index ff0eb56ca..968cc3988 100644 --- a/scylla/src/transport/errors.rs +++ b/scylla/src/transport/errors.rs @@ -724,7 +724,6 @@ impl ConnectionSetupRequestError { /// - failed to handle a server event (message received on stream -1) /// - some low-level IO errors - e.g. driver failed to write data via socket #[derive(Error, Debug, Clone)] -#[error("Connection broken, reason: {0}")] pub struct BrokenConnectionError(Arc); impl BrokenConnectionError { @@ -734,6 +733,12 @@ impl BrokenConnectionError { } } +impl std::fmt::Display for BrokenConnectionError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Connection broken, reason: {}", self.0) + } +} + /// A reason why connection was broken. /// /// See [`BrokenConnectionError::downcast_ref()`].