| 174 | } |
| 175 | |
| 176 | void WorkerRunningRequest::send_error(td::Status error) { |
| 177 | if (completed_) { |
| 178 | return; |
| 179 | } |
| 180 | LOG(WARNING) << "worker request " << proxy_request_id_.to_hex() << " failed: " << error; |
| 181 | |
| 182 | auto final_info = create_final_info(); |
| 183 | auto ans = cocoon::create_serialize_tl_object<cocoon_api::proxy_queryAnswerErrorEx>( |
| 184 | proxy_request_id_, error.code(), error.message().str(), 1, std::move(final_info)); |
| 185 | td::actor::send_closure(runner_, &WorkerRunner::send_message_to_connection, proxy_connection_id_, std::move(ans)); |
| 186 | sent_answer_ = true; |
| 187 | |
| 188 | finish_request(false); |
| 189 | } |
| 190 | |
| 191 | void WorkerRunningRequest::send_answer(td::int32 status_code, std::vector<std::pair<std::string, std::string>> headers, |
| 192 | std::string orig_payload, bool payload_is_completed) { |