MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / processError

Method processError

programs/client/Client.cpp:85–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83Client::~Client() = default;
84
85void 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
130void Client::showWarnings()

Callers

nothing calls this directly

Calls 5

printFunction · 0.50
codeMethod · 0.45
rethrowMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected