3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-29 23:39:24 +01:00

EventDispatcher: remove handler if it has errors

This commit is contained in:
Pragmatic Software 2020-01-31 00:58:04 -08:00
parent b7e622a32e
commit f557307a8a

View File

@ -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;