diff options
| author | 2023-10-26 02:07:43 +0800 | |
|---|---|---|
| committer | 2023-10-26 02:07:43 +0800 | |
| commit | 588ae0692789b56607aaf15658b23f069877e481 (patch) | |
| tree | 0440f5d5e991282f8e953aba3be874f003daad1b /src/hydrorollcore/core.py | |
| parent | d3db3acda76ebc5d25b9ef661b6a63089dee0720 (diff) | |
| download | infini-588ae0692789b56607aaf15658b23f069877e481.tar.gz infini-588ae0692789b56607aaf15658b23f069877e481.zip | |
feat: newdocs
Diffstat (limited to 'src/hydrorollcore/core.py')
| -rw-r--r-- | src/hydrorollcore/core.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hydrorollcore/core.py b/src/hydrorollcore/core.py index f3c83989..56ec9404 100644 --- a/src/hydrorollcore/core.py +++ b/src/hydrorollcore/core.py @@ -15,12 +15,14 @@ class Core: try: module = importlib.import_module(rule) except ImportError as e: - raise RuleLoadError(f'Failed to load rule {rule}: {e}') + raise RuleLoadError(f'Failed to load rule {rule}: {e}') from e try: rule_cls = getattr(module, rule.split('.')[-1]) if not issubclass(rule_cls, Rule): raise RuleLoadError(f"Class '{rule_cls.__name__}' is not a subclass of 'Rule'") except AttributeError as e: - raise RuleLoadError(f"Failed to get rule class from module '{rule}': {e}") + raise RuleLoadError( + f"Failed to get rule class from module '{rule}': {e}" + ) from e loaded_rules.append(rule_cls()) return loaded_rules |
