I put my extensions in a folder structure like this
|--exts
| |--fun
| |--__init__.py
| |--fun1.py
| |--fun2.py
In the __init__.py file, I write this:
import logging
import interactions
from src.const import EXT_FUN
class Fun(interactions.Extension):
"""exts/fun Extension."""
def __init__(self, client: interactions.Client) -> None:
self.client: interactions.Client = client
for ext in EXT_FUN:
try:
self.client.load_extension(f"src.exts.fun.{ext}")
except interactions.errors.ExtensionLoadException:
logging.critical(f"src.exts.fun.{ext} failed to loaded.")
pass
def setup(client) -> None:
"""Setup the extension"""
Fun(client)
logging.info("Loaded Fun extension.")
The problem here is, if fun1.py has an error, instead of passing it and continue loading fun2.py, it stops here. How to pass the fun1.py error file and continue loading the fun2.py file?