mirror of
https://github.com/Nick80835/microbot
synced 2025-08-31 06:26:04 +00:00
catch errors when loading modules upon startup
This commit is contained in:
@@ -30,7 +30,10 @@ class Loader():
|
||||
self._find_all_modules()
|
||||
|
||||
for module_name in self.all_modules:
|
||||
self.loaded_modules.append(import_module("ubot.modules." + module_name))
|
||||
try:
|
||||
self.loaded_modules.append(import_module("ubot.modules." + module_name))
|
||||
except Exception as exception:
|
||||
self.logger.error(f"Error while loading {module_name}: {exception}")
|
||||
|
||||
def reload_all_modules(self):
|
||||
self.command_handler.incoming_commands = []
|
||||
|
Reference in New Issue
Block a user