From f0f31ab8f39a11670f87a54e86869831d8d4aab2 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Thu, 9 Sep 2021 23:53:24 +0300 Subject: [PATCH] client: print full query in case of server exception --- programs/client/Client.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/programs/client/Client.cpp b/programs/client/Client.cpp index 58fc80ef958..4e59cca2024 100644 --- a/programs/client/Client.cpp +++ b/programs/client/Client.cpp @@ -1031,10 +1031,17 @@ private: if (server_exception) { bool print_stack_trace = config().getBool("stacktrace", false); - std::cerr << "Received exception from server (version " << server_version << "):" << std::endl - << getExceptionMessage(*server_exception, print_stack_trace, true) << std::endl; + fmt::print(stderr, "Received exception from server (version {}):\n{}\n", + server_version, + getExceptionMessage(*server_exception, print_stack_trace, true)); if (is_interactive) - std::cerr << std::endl; + { + fmt::print(stderr, "\n"); + } + else + { + fmt::print(stderr, "(query: {})\n", full_query); + } } if (client_exception)