client: print full query in case of server exception

This commit is contained in:
Azat Khuzhin 2021-09-09 23:53:24 +03:00
parent af5072db50
commit f0f31ab8f3

View File

@ -1031,10 +1031,17 @@ private:
if (server_exception) if (server_exception)
{ {
bool print_stack_trace = config().getBool("stacktrace", false); bool print_stack_trace = config().getBool("stacktrace", false);
std::cerr << "Received exception from server (version " << server_version << "):" << std::endl fmt::print(stderr, "Received exception from server (version {}):\n{}\n",
<< getExceptionMessage(*server_exception, print_stack_trace, true) << std::endl; server_version,
getExceptionMessage(*server_exception, print_stack_trace, true));
if (is_interactive) if (is_interactive)
std::cerr << std::endl; {
fmt::print(stderr, "\n");
}
else
{
fmt::print(stderr, "(query: {})\n", full_query);
}
} }
if (client_exception) if (client_exception)