From 3d0c3166f39cd8e1904c8a3955e103a8b139548e Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 22 Dec 2021 11:10:39 +0100 Subject: [PATCH] More concise/consistent error messages --- src/error.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/error.rs b/src/error.rs index 1696d08..45b1f4d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -23,11 +23,12 @@ impl StdError for Error {} impl Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { + Error::Io(e) => write!(f, "I/O error: {}", e), Error::Command(e) => { - write!(f, "epp-client EppCommandError: {}", e.result.message) + write!(f, "command error: {}", e.result.message) } - Error::Other(e) => write!(f, "epp-client Exception: {}", e), - _ => write!(f, "epp-client Exception: {:?}", self), + Error::Xml(e) => write!(f, "(de)serialization error: {}", e), + Error::Other(e) => write!(f, "error: {}", e), } } }