Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mrDoctorWho/vk4xmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Smith <mrdoctorwho@helldev.net>2020-11-30 17:42:46 +0300
committerJohn Smith <mrdoctorwho@helldev.net>2020-11-30 17:42:46 +0300
commit53eb48f6dc8c367edb3622adf8f3e9416f6bfc17 (patch)
treeb33b63a134a0b6142e5d1778024ecab1aade20fc /extensions
parente379c936d17b0af2eb50efbf5f9d39a5e35a0ee8 (diff)
Make transport methods more strict about arguments' values; don't exterminate users on API errors
Diffstat (limited to 'extensions')
-rw-r--r--extensions/groupchats.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/extensions/groupchats.py b/extensions/groupchats.py
index 47e6f1b..17ba0a1 100644
--- a/extensions/groupchats.py
+++ b/extensions/groupchats.py
@@ -270,7 +270,7 @@ class Chat(object):
if not self.raw_users:
vkChat = self.getVKChat(user, self.id)
if not vkChat:
- raise RuntimeError("Unable to retrieve VK chat users list")
+ raise RuntimeError("Unable to retrieve VK chat users list for user %s with chat id: %s" % (user, self.id))
self.raw_users = vkChat["users"]
name = "@%s" % TransportID
@@ -407,10 +407,10 @@ class Chat(object):
Get vk chat by id
"""
chat = user.vk.method("messages.getChat", {"chat_id": id})
+ if not chat:
+ raise RuntimeError("Unable to get a chat! User: %s, id: %s" % (user, id))
users = chat.get("users", [])
users = sorted(users)[:CHAT_USERS_LIMIT]
- if not chat:
- raise RuntimeError("Unable to get a chat!")
return chat
@staticmethod