Permalink
Browse files

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
  • Loading branch information...
1 parent 208a0cd commit 173a2d26f55a6c184e31821072f18f49d2b28c7d @abh abh committed Oct 17, 2002
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/Qpsmtpd.pm
View
@@ -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;

0 comments on commit 173a2d2

Please sign in to comment.