From 324317ff6f0bf1559b6890b68e1842402b697d74 Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 27 May 2019 21:56:50 +0300 Subject: [PATCH] clickhouse-client: allow to run with unaccessable history file (read only, no disk space, file is directory, ...) --- dbms/programs/client/Client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/programs/client/Client.cpp b/dbms/programs/client/Client.cpp index da773bc2f13..d8081d7c97c 100644 --- a/dbms/programs/client/Client.cpp +++ b/dbms/programs/client/Client.cpp @@ -435,7 +435,7 @@ private: #if USE_READLINE int res = read_history(history_file.c_str()); if (res) - throwFromErrno("Cannot read history from file " + history_file, ErrorCodes::CANNOT_READ_HISTORY); + std::cerr << "Cannot read history from file " + history_file + ": "+ errnoToString(ErrorCodes::CANNOT_READ_HISTORY); #endif } else /// Create history file. @@ -612,7 +612,7 @@ private: #if USE_READLINE && HAVE_READLINE_HISTORY if (!history_file.empty() && append_history(1, history_file.c_str())) - throwFromErrno("Cannot append history to file " + history_file, ErrorCodes::CANNOT_APPEND_HISTORY); + std::cerr << "Cannot append history to file " + history_file + ": " + errnoToString(ErrorCodes::CANNOT_APPEND_HISTORY); #endif prev_input = input;