aboutsummaryrefslogtreecommitdiff
path: root/modules/config.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-17 11:27:48 +0100
committerGravatar jesopo2019-06-17 11:27:48 +0100
commit99a314ed01489fcd10689c5cd54cbcb4b03284b7 (patch)
treef9c334aa4a2c9daa94d02859d8518a5e5b67ecf9 /modules/config.py
parentChange panic() reason log from ERROR to CRITICAL (diff)
signature
Catch _to_context ValueError and show pretty error
Diffstat (limited to 'modules/config.py')
-rw-r--r--modules/config.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/config.py b/modules/config.py
index 18a16c56..1262aa5a 100644
--- a/modules/config.py
+++ b/modules/config.py
@@ -134,8 +134,13 @@ class Module(ModuleManager.BaseModule):
if arg_count > 2:
value = " ".join(event["args_split"][2:])
- target, context = self._to_context(event["server"],
- event["target"], event["user"], context_desc)
+ try:
+ target, context = self._to_context(event["server"],
+ event["target"], event["user"], context_desc)
+ except ValueError:
+ raise utils.EventError(
+ "Unknown context. Please provide "
+ "'user', 'channel', 'server' or 'bot'")
permission_check = utils.Check("permission", "config")