fix: reduce show text length

This commit is contained in:
Alex Duan 2024-11-28 11:03:07 +08:00
parent c4a5969d7f
commit 8c3a5e2464
2 changed files with 5 additions and 5 deletions

View File

@ -1091,7 +1091,7 @@ void shellCleanupHistory() {
void shellPrintError(TAOS_RES *tres, int64_t st) { void shellPrintError(TAOS_RES *tres, int64_t st) {
int64_t et = taosGetTimestampUs(); 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); taos_free_result(tres);
} }
@ -1303,7 +1303,7 @@ int32_t shellExecute() {
#ifdef WEBSOCKET #ifdef WEBSOCKET
if (shell.args.restful || shell.args.cloud) { if (shell.args.restful || shell.args.cloud) {
if (shell_conn_ws_server(1)) { 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); fflush(stdout);
return -1; return -1;
} }
@ -1316,7 +1316,7 @@ int32_t shellExecute() {
} }
if (shell.conn == NULL) { 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); fflush(stdout);
return -1; return -1;
} }

View File

@ -286,8 +286,8 @@ void shellRunSingleCommandWebsocketImp(char *command) {
// if it's not a ws connection error // if it's not a ws connection error
if (TSDB_CODE_WS_DSN_ERROR != (code&TSDB_CODE_WS_DSN_ERROR)) { if (TSDB_CODE_WS_DSN_ERROR != (code&TSDB_CODE_WS_DSN_ERROR)) {
et = taosGetTimestampUs(); et = taosGetTimestampUs();
fprintf(stderr, "\nDB: error: %s (%.6fs)\n", fprintf(stderr, "\nDB: error:0x%08X %s (%.6fs)\n",
ws_errstr(res), (et - st)/1E6); ws_errno(res), ws_errstr(res), (et - st)/1E6);
ws_free_result(res); ws_free_result(res);
return; return;
} }