Improve error messages.

This commit is contained in:
levlam 2021-06-25 21:21:17 +03:00
parent cf2be88c34
commit eb134b02f2
3 changed files with 4 additions and 4 deletions

View File

@ -127,7 +127,7 @@ class SetAccountTtlQuery : public Td::ResultHandler {
bool result = result_ptr.move_as_ok(); bool result = result_ptr.move_as_ok();
if (!result) { if (!result) {
return on_error(id, Status::Error(500, "Internal Server Error")); return on_error(id, Status::Error(500, "Internal Server Error: failed to set account TTL"));
} }
promise_.set_value(Unit()); promise_.set_value(Unit());
@ -2151,7 +2151,7 @@ class ImportChatInviteQuery : public Td::ResultHandler {
auto dialog_ids = UpdatesManager::get_chat_dialog_ids(ptr.get()); auto dialog_ids = UpdatesManager::get_chat_dialog_ids(ptr.get());
if (dialog_ids.size() != 1u) { if (dialog_ids.size() != 1u) {
LOG(ERROR) << "Receive wrong result for ImportChatInviteQuery: " << to_string(ptr); LOG(ERROR) << "Receive wrong result for ImportChatInviteQuery: " << to_string(ptr);
return on_error(id, Status::Error(500, "Internal Server Error")); return on_error(id, Status::Error(500, "Internal Server Error: failed to join chat by invite link"));
} }
auto dialog_id = dialog_ids[0]; auto dialog_id = dialog_ids[0];

View File

@ -2681,7 +2681,7 @@ StickerSetId StickersManager::on_get_messages_sticker_set(StickerSetId sticker_s
} }
if (sticker_set_id.is_valid() && sticker_set_id != set_id) { if (sticker_set_id.is_valid() && sticker_set_id != set_id) {
LOG(ERROR) << "Expected " << sticker_set_id << ", but receive " << set_id << " from " << source; LOG(ERROR) << "Expected " << sticker_set_id << ", but receive " << set_id << " from " << source;
on_load_sticker_set_fail(sticker_set_id, Status::Error(500, "Internal Server Error")); on_load_sticker_set_fail(sticker_set_id, Status::Error(500, "Internal Server Error: wrong sticker set received"));
return StickerSetId(); return StickerSetId();
} }

View File

@ -302,7 +302,7 @@ Result<size_t> FileUploader::process_part(Part part, NetQueryPtr net_query) {
} }
if (!result.ok()) { if (!result.ok()) {
// TODO: it is possible // TODO: it is possible
return Status::Error(500, "Internal Server Error"); return Status::Error(500, "Internal Server Error during file upload");
} }
return part.size; return part.size;
} }