Add td_api::testReturnError instead of td_api::testUseError.

GitOrigin-RevId: a51a927bd6ac0b8e7b75b1f032c3b232d8f42f52
This commit is contained in:
levlam 2019-08-06 02:03:44 +03:00
parent 8059ac0472
commit 46bb21bbd0
5 changed files with 9 additions and 6 deletions

View File

@ -4010,5 +4010,5 @@ testProxy server:string port:int32 type:ProxyType = Ok;
testGetDifference = Ok;
//@description Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization
testUseUpdate = Update;
//@description Does nothing and ensures that the Error object is used; for testing only. This is an offline method. Can be called before authorization
testUseError = Error;
//@description Returns the specified error and ensures that the Error object is used; for testing only. This is an offline method. Can be called before authorization @error The error to be returned
testReturnError error:error = Error;

Binary file not shown.

View File

@ -3433,7 +3433,7 @@ bool Td::is_preinitialization_request(int32 id) {
case td_api::getCurrentState::ID:
case td_api::setAlarm::ID:
case td_api::testUseUpdate::ID:
case td_api::testUseError::ID:
case td_api::testReturnError::ID:
case td_api::testCallEmpty::ID:
case td_api::testSquareInt::ID:
case td_api::testCallString::ID:
@ -7686,8 +7686,8 @@ void Td::on_request(uint64 id, td_api::testUseUpdate &request) {
send_closure(actor_id(this), &Td::send_result, id, nullptr);
}
void Td::on_request(uint64 id, td_api::testUseError &request) {
send_closure(actor_id(this), &Td::send_result, id, nullptr);
void Td::on_request(uint64 id, td_api::testReturnError &request) {
send_closure(actor_id(this), &Td::send_result, id, std::move(request.error_));
}
void Td::on_request(uint64 id, td_api::testCallEmpty &request) {

View File

@ -1027,7 +1027,7 @@ class Td final : public NetQueryCallback {
void on_request(uint64 id, td_api::testProxy &request);
void on_request(uint64 id, td_api::testGetDifference &request);
void on_request(uint64 id, td_api::testUseUpdate &request);
void on_request(uint64 id, td_api::testUseError &request);
void on_request(uint64 id, td_api::testReturnError &request);
void on_request(uint64 id, td_api::testCallEmpty &request);
void on_request(uint64 id, td_api::testSquareInt &request);
void on_request(uint64 id, td_api::testCallString &request);

View File

@ -3483,6 +3483,9 @@ class CliClient final : public Actor {
} else if (op == "racm") {
string chat_id = args;
send_request(td_api::make_object<td_api::readAllChatMentions>(as_chat_id(chat_id)));
} else if (op == "tre") {
send_request(td_api::make_object<td_api::testReturnError>(
args.empty() ? nullptr : td_api::make_object<td_api::error>(-1, args)));
} else if (op == "dpp") {
send_request(td_api::make_object<td_api::deleteProfilePhoto>(to_integer<int64>(args)));
} else if (op == "gcnse" || op == "gcnses") {