| 83 | Client::~Client() = default; |
| 84 | |
| 85 | void Client::processError(std::string_view query) const |
| 86 | { |
| 87 | if (server_exception) |
| 88 | { |
| 89 | fmt::print( |
| 90 | stderr, |
| 91 | "Received exception from server (version {}):\n{}\n", |
| 92 | server_version, |
| 93 | getExceptionMessageForLogging(*server_exception, print_stack_trace, true)); |
| 94 | |
| 95 | if (server_exception->code() == ErrorCodes::USER_EXPIRED) |
| 96 | { |
| 97 | server_exception->rethrow(); |
| 98 | } |
| 99 | |
| 100 | if (is_interactive) |
| 101 | { |
| 102 | fmt::print(stderr, "\n"); |
| 103 | } |
| 104 | else |
| 105 | { |
| 106 | fmt::print(stderr, "(query: {})\n", query); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | if (client_exception) |
| 111 | { |
| 112 | fmt::print(stderr, "Error on processing query: {}\n", client_exception->message()); |
| 113 | |
| 114 | if (is_interactive) |
| 115 | { |
| 116 | fmt::print(stderr, "\n"); |
| 117 | } |
| 118 | else |
| 119 | { |
| 120 | fmt::print(stderr, "(query: {})\n", query); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | // A debug check -- at least some exception must be set, if the error |
| 125 | // flag is set, and vice versa. |
| 126 | chassert(have_error == (client_exception || server_exception)); |
| 127 | } |
| 128 | |
| 129 | |
| 130 | void Client::showWarnings() |
nothing calls this directly
no test coverage detected