Commit 211ae1ad authored by Perceval Guillou's avatar Perceval Guillou Committed by Matias Guijarro
Browse files

better error message of the find_class_and_node function.

Display the plugin base path.
parent c65cadd2
......@@ -33,9 +33,17 @@ def find_class_and_node(cfg_node, base_path="bliss.controllers"):
module = __import__(module_name, fromlist=[""])
except ModuleNotFoundError:
except ModuleNotFoundError as e:
module_name = "%s.%s" % (base_path, camel_case_to_snake_style(klass_name))
module = __import__(module_name, fromlist=[""])
module = __import__(module_name, fromlist=[""])
except ModuleNotFoundError as e2:
msg = "\nWITH CONFIG MODULE NAME: " + e.msg
msg += "\nWITH DEFAULT MODULE NAME: " + e2.msg
msg += f"\nCHECK THAT MODULE NAME BEGINS AFTER '{base_path}'\n"
e2.msg = msg
raise e2
klass = getattr(module, klass_name)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment