Refine transaction log count message (#13378)

(cherry picked from commit b5ef319038)

Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
mergify[bot]
2020-11-04 06:44:49 +00:00
committed by GitHub
parent 62db7f6562
commit ee18e7668b

View File

@ -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,