WEEE-Open / weeelab-telegram-bot

Telegram bot for querying the weeelab log and some additional cool stuff.
GNU General Public License v3.0
8 stars 4 forks source link

Add infinite retries in main in case of network absence #75

Open e-caste opened 4 years ago

e-caste commented 4 years ago

Add a

while True:
    try:
       stuff
    except MegaNetworkErrorException:
       sleep(30)

to the main to survive network absence gracefully.

The observed exception is given by the OwnCloud login under the name requests.exceptions.ConnectionError: HTTPSConnectionPool(host='cloud.weeeopen.it', port=443): Max retries exceeded with url: /ocs/v1.php/cloud/capabilities (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7471b7f0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

e-caste commented 4 years ago

Added low priority label since the bot is run as a service that restarts automatically on crash.