From b53c4ba62a59a62a888149a9883c782b9fe7e23f Mon Sep 17 00:00:00 2001 From: Firstyear Date: Fri, 23 Aug 2024 12:51:22 +1000 Subject: [PATCH] Better Error Message (#2998) * fix(cli) better error Messages --------- Co-authored-by: James Hodgkinson --- tools/cli/src/cli/lib.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/cli/src/cli/lib.rs b/tools/cli/src/cli/lib.rs index 496b4459a..0ba62192c 100644 --- a/tools/cli/src/cli/lib.rs +++ b/tools/cli/src/cli/lib.rs @@ -41,21 +41,19 @@ mod webauthn; /// Throws an error and exits the program when we get an error pub(crate) fn handle_client_error(response: ClientError, _output_mode: OutputMode) { match response { - ClientError::Http(status, error, message) => { + ClientError::Http(status, error, opid) => { let error_msg = match error { Some(msg) => format!(" {:?}", msg), None => "".to_string(), }; + error!("OperationId: {:?}", opid); if status == StatusCode::INTERNAL_SERVER_ERROR { - error!( - "Internal Server Error in response:{:?} {:?}", - error_msg, message - ); + error!("Internal Server Error in response: {}", error_msg); std::process::exit(1); } else if status == StatusCode::NOT_FOUND { - error!("Item not found:{:?} {:?}", error_msg, message) + error!("Item not found: Check all names are correct."); } else { - error!("HTTP Error: {}{} {:?}", status, error_msg, message); + error!("HTTP Error: {}{}", status, error_msg); } } ClientError::Transport(e) => {