better error messages when a plugin fails
remove some debug messages in the log git-svn-id: https://svn.perl.org/qpsmtpd/trunk@89 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
208a0cd54c
commit
173a2d26f5
@ -24,7 +24,7 @@ sub log {
|
||||
sub config {
|
||||
my ($self, $c) = @_;
|
||||
|
||||
warn "SELF->config($c) ", ref $self;
|
||||
#warn "SELF->config($c) ", ref $self;
|
||||
|
||||
my %defaults = (
|
||||
me => hostname,
|
||||
@ -130,10 +130,13 @@ sub run_hooks {
|
||||
if ($self->{_hooks}->{$hook}) {
|
||||
my @r;
|
||||
for my $code (@{$self->{_hooks}->{$hook}}) {
|
||||
$self->log(1, "running plugin ", $code->{name});
|
||||
$self->log(5, "running plugin ", $code->{name});
|
||||
eval { (@r) = &{$code->{code}}($self->transaction, @_); };
|
||||
$@ and $self->log(0, "FATAL PLUGIN ERROR: ", $@) and next;
|
||||
$self->log(1, "a $hook hook returned undef!") and next unless defined $r[0];
|
||||
!defined $r[0]
|
||||
and $self->log(1, "plugin ".$code->{name}
|
||||
."running the $hook hook returned undef!")
|
||||
and next;
|
||||
last unless $r[0] == DECLINED;
|
||||
}
|
||||
return @r;
|
||||
|
Loading…
Reference in New Issue
Block a user