From 8c3a5e246456579223fbb0b213b33e87ab2c7703 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Thu, 28 Nov 2024 11:03:07 +0800 Subject: [PATCH] fix: reduce show text length --- tools/shell/src/shellEngine.c | 6 +++--- tools/shell/src/shellWebsocket.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 18d56c23aa..21048a241c 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -1091,7 +1091,7 @@ void shellCleanupHistory() { void shellPrintError(TAOS_RES *tres, int64_t st) { int64_t et = taosGetTimestampUs(); - fprintf(stderr, "\r\nDB error:[%08X] %s (%.6fs)\r\n", taos_errno(tres), taos_errstr(tres), (et - st) / 1E6); + fprintf(stderr, "\r\nDB error:0x%08X %s (%.6fs)\r\n", taos_errno(tres), taos_errstr(tres), (et - st) / 1E6); taos_free_result(tres); } @@ -1303,7 +1303,7 @@ int32_t shellExecute() { #ifdef WEBSOCKET if (shell.args.restful || shell.args.cloud) { if (shell_conn_ws_server(1)) { - printf("failed to connect to server, error code:0x08X reason: %s\n", ws_errno(NULL), ws_errstr(NULL)); + printf("failed to connect to server, code:0x08X %s\n", ws_errno(NULL), ws_errstr(NULL)); fflush(stdout); return -1; } @@ -1316,7 +1316,7 @@ int32_t shellExecute() { } if (shell.conn == NULL) { - printf("failed to connect to server, error code:0x%08X reason: %s\n", taos_errno(NULL), taos_errstr(NULL)); + printf("failed to connect to server, code:0x%08X %s\n", taos_errno(NULL), taos_errstr(NULL)); fflush(stdout); return -1; } diff --git a/tools/shell/src/shellWebsocket.c b/tools/shell/src/shellWebsocket.c index 1ec1697c3a..61074102be 100644 --- a/tools/shell/src/shellWebsocket.c +++ b/tools/shell/src/shellWebsocket.c @@ -286,8 +286,8 @@ void shellRunSingleCommandWebsocketImp(char *command) { // if it's not a ws connection error if (TSDB_CODE_WS_DSN_ERROR != (code&TSDB_CODE_WS_DSN_ERROR)) { et = taosGetTimestampUs(); - fprintf(stderr, "\nDB: error: %s (%.6fs)\n", - ws_errstr(res), (et - st)/1E6); + fprintf(stderr, "\nDB: error:0x%08X %s (%.6fs)\n", + ws_errno(res), ws_errstr(res), (et - st)/1E6); ws_free_result(res); return; }