MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / fail

Method fail

runners/proxy/ProxyRunningRequest.cpp:215–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215void ProxyRunningRequest::fail(td::Status error) {
216 LOG(WARNING) << "proxy request " << id_.to_hex() << " is failed: " << error;
217 td::BufferSlice res;
218 if (client_proto_version_ > 0) {
219 auto final_info = create_final_info(nullptr);
220 res = cocoon::create_serialize_tl_object<cocoon_api::client_queryAnswerErrorEx>(
221 client_request_id_, error.code(), error.message().str(), 1, std::move(final_info));
222 } else if (!sent_answer_) {
223 res = cocoon::create_serialize_tl_object<cocoon_api::client_queryAnswerError>(error.code(), error.message().str(),
224 client_request_id_, tokens_used());
225 } else {
226 res = cocoon::create_serialize_tl_object<cocoon_api::client_queryAnswerPartError>(
227 error.code(), error.message().str(), client_request_id_, tokens_used());
228 }
229 td::actor::send_closure(runner_, &ProxyRunner::send_message_to_connection, client_connection_id_, std::move(res));
230 finish(false);
231}
232
233void ProxyRunningRequest::finish(bool is_success) {
234 CHECK(tokens_used_);

Callers

nothing calls this directly

Calls 1

codeMethod · 0.80

Tested by

no test coverage detected