mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-12-24 11:45:51 +01:00
Add logging on errors with non-positive error code.
This commit is contained in:
parent
b8693ae500
commit
b7af179809
@ -60,6 +60,10 @@ void Client::fail_query_with_error(PromisedQueryPtr query, int32 error_code, Sli
|
||||
int32 real_error_code = error_code;
|
||||
Slice real_error_message = error_message;
|
||||
if (error_code < 300 || error_code == 404) {
|
||||
if (error_code <= 0) {
|
||||
LOG(ERROR) << "Receive error \"" << real_error_message << "\" with code " << error_code << " from " << *query;
|
||||
}
|
||||
|
||||
error_code = 400;
|
||||
}
|
||||
if (error_code == 400) {
|
||||
|
@ -166,7 +166,7 @@ td::Status WebhookActor::create_connection() {
|
||||
Callback &operator=(Callback &&) = delete;
|
||||
~Callback() {
|
||||
if (!actor_.empty()) {
|
||||
send_closure(std::move(actor_), &WebhookActor::on_socket_ready_async, td::Status::Error("Cancelled"), id_);
|
||||
send_closure(std::move(actor_), &WebhookActor::on_socket_ready_async, td::Status::Error("Canceled"), id_);
|
||||
}
|
||||
}
|
||||
void on_connected() override {
|
||||
|
Loading…
Reference in New Issue
Block a user