Support new BOT_RESPONSE_TIMEOUT error.

GitOrigin-RevId: 958289f3dab582be0560f7dc11598210448d5139
This commit is contained in:
levlam 2020-07-06 17:39:53 +03:00
parent c56f2a8c1d
commit 01d367ea9b
2 changed files with 4 additions and 0 deletions

View File

@ -80,6 +80,8 @@ class GetBotCallbackAnswerQuery : public Td::ResultHandler {
void on_error(uint64 id, Status status) override {
if (status.message() == "DATA_INVALID") {
td->messages_manager_->get_message_from_server({dialog_id_, message_id_}, Auto());
} else if (status.message() == "BOT_RESPONSE_TIMEOUT") {
status = Status::Error(502, "The bot is not responding");
}
td->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetBotCallbackAnswerQuery");
td->callback_queries_manager_->on_get_callback_query_answer(result_id_, nullptr);

View File

@ -102,6 +102,8 @@ class GetInlineBotResultsQuery : public Td::ResultHandler {
void on_error(uint64 id, Status status) override {
if (status.code() == NetQuery::Cancelled) {
status = Status::Error(406, "Request cancelled");
} else if (status.message() == "BOT_RESPONSE_TIMEOUT") {
status = Status::Error(502, "The bot is not responding");
}
LOG(INFO) << "Inline query returned error " << status;