diff options
author | 2019-09-26 18:33:23 -0700 | |
---|---|---|
committer | 2019-10-01 18:25:30 -0700 | |
commit | ae237539578d9baafde8e16d68e61133cf1ca481 (patch) | |
tree | c90f57ea3a0fdc0d3b3fa3ac6519215dccdc70c2 | |
parent | Support positional target arg for respect_role_hierarchy (diff) |
Raise ValueError in respect_role_hierarchy instead of logging errors
-rw-r--r-- | bot/decorators.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/decorators.py b/bot/decorators.py index d8a9494d2..25d1b694d 100644 --- a/bot/decorators.py +++ b/bot/decorators.py @@ -165,9 +165,9 @@ def respect_role_hierarchy(target_arg: Union[int, str] = 0) -> Callable: try: target = args[target_arg] except IndexError: - log.error(f"Could not find target member argument at position {target_arg}") + raise ValueError(f"Could not find target argument at position {target_arg}") except TypeError: - log.error(f"Could not find target member kwarg with key {target_arg!r}") + raise ValueError(f"Could not find target kwarg with key {target_arg!r}") if not isinstance(target, Member): log.trace("The target is not a discord.Member; skipping role hierarchy check.") |