mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-12-25 04:05:52 +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;
|
int32 real_error_code = error_code;
|
||||||
Slice real_error_message = error_message;
|
Slice real_error_message = error_message;
|
||||||
if (error_code < 300 || error_code == 404) {
|
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;
|
error_code = 400;
|
||||||
}
|
}
|
||||||
if (error_code == 400) {
|
if (error_code == 400) {
|
||||||
|
@ -166,7 +166,7 @@ td::Status WebhookActor::create_connection() {
|
|||||||
Callback &operator=(Callback &&) = delete;
|
Callback &operator=(Callback &&) = delete;
|
||||||
~Callback() {
|
~Callback() {
|
||||||
if (!actor_.empty()) {
|
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 {
|
void on_connected() override {
|
||||||
|
Loading…
Reference in New Issue
Block a user