diff options
| -rw-r--r-- | bot/__main__.py | 4 | ||||
| -rw-r--r-- | bot/bot.py | 2 | 
2 files changed, 4 insertions, 2 deletions
| diff --git a/bot/__main__.py b/bot/__main__.py index d3abcd7b2..9317563c8 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -15,7 +15,7 @@ try:      bot.instance.run(constants.Bot.token)  except StartupError as e:      message = "Unknown Startup Error Occurred." -    if type(e.exception) in [aiohttp.ClientConnectorError, aiohttp.ServerDisconnectedError]: +    if isinstance(e.exception, (aiohttp.ClientConnectorError, aiohttp.ServerDisconnectedError)):          message = "Could not connect to site API. Is it running?"      elif isinstance(e.exception, OSError):          message = "Could not connect to Redis. Is it running?" @@ -24,3 +24,5 @@ except StartupError as e:      log = logging.getLogger("bot")      log.fatal("", exc_info=e.exception)      log.fatal(message) + +    exit(69) diff --git a/bot/bot.py b/bot/bot.py index 1a815c31e..3218a60b4 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -102,7 +102,7 @@ class Bot(commands.Bot):              except (aiohttp.ClientConnectorError, aiohttp.ServerDisconnectedError) as e:                  attempts += 1                  if attempts == constants.URLs.connect_max_retries: -                    raise e +                    raise                  await asyncio.sleep(constants.URLs.connect_cooldown)      @classmethod | 
