diff --git a/programs/client/Client.cpp b/programs/client/Client.cpp index 7f48a9987c7..d2527ad0c98 100644 --- a/programs/client/Client.cpp +++ b/programs/client/Client.cpp @@ -325,7 +325,7 @@ try processConfig(); adjustSettings(); - initTtyBuffer(toProgressOption(config().getString("progress", "default"))); + initTTYBuffer(toProgressOption(config().getString("progress", "default"))); { // All that just to set DB::CurrentThread::get().getGlobalContext() @@ -1459,7 +1459,6 @@ int mainEntryClickHouseClient(int argc, char ** argv) DB::Client client; // Initialize command line options client.init(argc, argv); - /// Initialize config file return client.run(); } catch (const DB::Exception & e) diff --git a/programs/keeper/Keeper.cpp b/programs/keeper/Keeper.cpp index 8a4ec646ce1..e04e669abae 100644 --- a/programs/keeper/Keeper.cpp +++ b/programs/keeper/Keeper.cpp @@ -556,7 +556,8 @@ catch (...) { /// Poco does not provide stacktrace. tryLogCurrentException("Application"); - return getCurrentExceptionCode(); + auto code = getCurrentExceptionCode(); + return code ? code : -1; } diff --git a/programs/local/LocalServer.cpp b/programs/local/LocalServer.cpp index 80ab173c150..f3b84fa3eb1 100644 --- a/programs/local/LocalServer.cpp +++ b/programs/local/LocalServer.cpp @@ -495,7 +495,7 @@ try processConfig(); adjustSettings(); - initTtyBuffer(toProgressOption(config().getString("progress", "default"))); + initTTYBuffer(toProgressOption(config().getString("progress", "default"))); applyCmdSettings(global_context); diff --git a/programs/server/Server.cpp b/programs/server/Server.cpp index 53e2db91f27..eeaceb8efe5 100644 --- a/programs/server/Server.cpp +++ b/programs/server/Server.cpp @@ -1970,7 +1970,8 @@ catch (...) { /// Poco does not provide stacktrace. tryLogCurrentException("Application"); - return getCurrentExceptionCode(); + auto code = getCurrentExceptionCode(); + return code ? code : -1; } std::unique_ptr Server::buildProtocolStackFromConfig( diff --git a/src/Client/ClientBase.cpp b/src/Client/ClientBase.cpp index bb10b104d3e..b513e623829 100644 --- a/src/Client/ClientBase.cpp +++ b/src/Client/ClientBase.cpp @@ -722,7 +722,7 @@ void ClientBase::adjustSettings() global_context->setSettings(settings); } -void ClientBase::initTtyBuffer(ProgressOption progress) +void ClientBase::initTTYBuffer(ProgressOption progress) { if (tty_buf) return; diff --git a/src/Client/ClientBase.h b/src/Client/ClientBase.h index 9fde23cf775..4eed8e0ace3 100644 --- a/src/Client/ClientBase.h +++ b/src/Client/ClientBase.h @@ -185,7 +185,7 @@ protected: /// Adjust some settings after command line options and config had been processed. void adjustSettings(); - void initTtyBuffer(ProgressOption progress); + void initTTYBuffer(ProgressOption progress); /// Should be one of the first, to be destroyed the last, /// since other members can use them.