mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 20:59:29 +00:00
More readable exception handling
This commit is contained in:
parent
2f2a381686
commit
e69fea4bb5
@ -802,15 +802,15 @@ class Client:
|
||||
Raises:
|
||||
:class:`Error <pyrogram.Error>`
|
||||
"""
|
||||
if self.is_started:
|
||||
r = self.session.send(data)
|
||||
if not self.is_started:
|
||||
raise ConnectionError("Client has not been started")
|
||||
|
||||
self.fetch_peers(getattr(r, "users", []))
|
||||
self.fetch_peers(getattr(r, "chats", []))
|
||||
r = self.session.send(data)
|
||||
|
||||
return r
|
||||
else:
|
||||
raise ConnectionError("client '{}' is not started".format(self.session_name))
|
||||
self.fetch_peers(getattr(r, "users", []))
|
||||
self.fetch_peers(getattr(r, "chats", []))
|
||||
|
||||
return r
|
||||
|
||||
def load_config(self):
|
||||
parser = ConfigParser()
|
||||
|
Loading…
Reference in New Issue
Block a user