mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-11-23 20:46:50 +01:00
Replace error code 403 with 400 in server-side errors just in case.
This commit is contained in:
parent
8a3d43daa9
commit
7fd2c2a22d
@ -65,6 +65,19 @@ void Client::fail_query_with_error(PromisedQueryPtr query, int32 error_code, Sli
|
|||||||
}
|
}
|
||||||
|
|
||||||
error_code = 400;
|
error_code = 400;
|
||||||
|
} else if (error_code == 403) {
|
||||||
|
bool is_server_error = true;
|
||||||
|
for (auto c : error_message) {
|
||||||
|
if (c == '_' || ('A' <= c && c <= 'Z') || td::is_digit(c)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
is_server_error = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (is_server_error) {
|
||||||
|
error_code = 400;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (error_code == 400) {
|
if (error_code == 400) {
|
||||||
if (!default_message.empty()) {
|
if (!default_message.empty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user