From f557307a8a82227a1f512b1086d6b81c49d4a992 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 31 Jan 2020 00:58:04 -0800 Subject: [PATCH] EventDispatcher: remove handler if it has errors --- PBot/EventDispatcher.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PBot/EventDispatcher.pm b/PBot/EventDispatcher.pm index 0ff114ad..f146a4ad 100644 --- a/PBot/EventDispatcher.pm +++ b/PBot/EventDispatcher.pm @@ -52,8 +52,8 @@ sub dispatch_event { if ($@) { chomp $@; $self->{pbot}->{logger}->log("Error in event handler: $@\n"); - #$self->{pbot}->{logger}->log("Removing handler.\n"); - #splice @{$self->{handlers}->{$event_type}}, $i--, 1; + $self->{pbot}->{logger}->log("Removing handler.\n"); + splice @{$self->{handlers}->{$event_type}}, $i--, 1; } return $ret if $ret; @@ -72,8 +72,8 @@ sub dispatch_event { if ($@) { chomp $@; $self->{pbot}->{logger}->log("Error in event handler: $@\n"); - #$self->{pbot}->{logger}->log("Removing handler.\n"); - #splice @{$self->{handlers}->{any}}, $i--, 1; + $self->{pbot}->{logger}->log("Removing handler.\n"); + splice @{$self->{handlers}->{any}}, $i--, 1; } return $ret if $ret;