From 887e4ba004446392f89b605727d6f7447b1b5452 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 9 Nov 2021 17:55:51 +0100 Subject: [PATCH] do not crash of failed calling of 'cli' method --- openpype/pype_commands.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openpype/pype_commands.py b/openpype/pype_commands.py index f4a29091d0..d4cba6f93e 100644 --- a/openpype/pype_commands.py +++ b/openpype/pype_commands.py @@ -47,9 +47,18 @@ class PypeCommands: from openpype.modules import ModulesManager manager = ModulesManager() + log = PypeLogger.get_logger("AddModulesCLI") for module in manager.modules: if hasattr(module, "cli"): - module.cli(click_func) + try: + module.cli(click_func) + + except Exception: + log.warning( + "Failed to add cli command for module \"{}\"".format( + module.name + ) + ) return click_func @staticmethod