diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 1d0ef686..e6028936 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -2696,13 +2696,17 @@ class Client: ) session.start() - - session.send( - functions.auth.ImportAuthorization( - id=exported_auth.id, - bytes=exported_auth.bytes + try: + session.send( + functions.auth.ImportAuthorization( + id=exported_auth.id, + bytes=exported_auth.bytes + ) ) - ) + except Exception as e: + session.stop() + raise e + else: session = Session( dc_id,