From b5ef3190384b3f8003c388b5b64b13e4a1d446c5 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 3 Nov 2020 20:23:41 -0800 Subject: [PATCH] Refine transaction log count message --- client/src/rpc_request.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/rpc_request.rs b/client/src/rpc_request.rs index b8b5fd320..731d80ca6 100644 --- a/client/src/rpc_request.rs +++ b/client/src/rpc_request.rs @@ -153,8 +153,12 @@ impl fmt::Display for RpcResponseErrorData { logs: Some(logs), .. }, ) => { - // Give the user a hint that there is more useful logging information available... - write!(f, "{} log messages", logs.len()) + if logs.is_empty() { + Ok(()) + } else { + // Give the user a hint that there is more useful logging information available... + write!(f, "[{} log messages]", logs.len()) + } } _ => Ok(()), } @@ -165,7 +169,7 @@ impl fmt::Display for RpcResponseErrorData { pub enum RpcError { #[error("RPC request error: {0}")] RpcRequestError(String), - #[error("RPC response error {code}: {message} [{data}]")] + #[error("RPC response error {code}: {message} {data}")] RpcResponseError { code: i64, message: String,