Add logging on errors with non-positive error code.

This commit is contained in:
levlam 2021-06-24 17:27:15 +03:00
parent b8693ae500
commit b7af179809
2 changed files with 5 additions and 1 deletions

View File

@ -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) {

View File

@ -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 {