aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-02-13 10:39:10 +0000
committerGravatar jesopo2019-02-13 10:39:10 +0000
commit1927c3c8afcd42e41e3d17c52daf62ac878fa6a4 (patch)
tree4282892eb5387944e6fe31fde0822d243b49ce8d /modules
parentNever allow use of MD2 (sasl.scram) (diff)
signature
Catch and propagate IRCv3's FAIL command (#357) (line_handler.py)
Diffstat (limited to 'modules')
-rw-r--r--modules/line_handler.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/line_handler.py b/modules/line_handler.py
index 8c4975b7..44bbf7c0 100644
--- a/modules/line_handler.py
+++ b/modules/line_handler.py
@@ -70,7 +70,18 @@ class Module(ModuleManager.BaseModule):
@utils.hook("raw.received.error")
def error(self, event):
- self.log.error("error received: %s", [event["args"][0]])
+ self.log.error("ERROR received: %s", [event["args"][0]])
+ @utils.hook("raw.received.fail")
+ def fail(self, event):
+ command = event["args"][0]
+ error_code = event["args"][1]
+ context = event["args"][2:-1]
+ description = event["args"][-1]
+
+ self.log.warn("FAIL (%s %s) received: %s" %
+ (command, error_code, description))
+ self.events.on("received.fail").call(command=command,
+ error_code=error_code, context=context, description=description)
# first numeric line the server sends
@utils.hook("raw.received.001", default_event=True)