Skip to content

Connection error  #2

@fly2hi

Description

@fly2hi

Hello
I am running the script on Windows
It’s running fine but sometimes I have connections errors on my computer
Is there a way to make the script rerun after connection error? The connection is usually restored after 2 minutes

thanks

Attempt 6 at connecting failed: OSError: [WinError 1232] The network location cannot be reached. For information about network troubleshooting, see Windows Help
Automatic reconnection failed 5 time(s)
Future exception was never retrieved
future: <Future finished exception=ConnectionError('Connection to Telegram failed 5 time(s)')>
ConnectionError: Connection to Telegram failed 5 time(s)
Traceback (most recent call last):
File "C:\Program Files\Python310\lib\asyncio\tasks.py", line 432, in wait_for
await waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\forwordbot\MsgForwarder.py", line 24, in
client.run_until_disconnected()
File "C:\Program Files\Python310\lib\site-packages\telethon\client\updates.py", line 84, in run_until_disconnected
return self.loop.run_until_complete(self._run_until_disconnected())
File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
return future.result()
File "C:\Program Files\Python310\lib\site-packages\telethon\client\updates.py", line 29, in _run_until_disconnected
return await self.disconnected
ConnectionError: Connection to Telegram failed 5 time(s)
PS C:\forwordbot> python MsgForwarder.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions