diff --git a/lib/Teapot/Bot/Brain.pm b/lib/Teapot/Bot/Brain.pm index 9bb5750..5780e5b 100644 --- a/lib/Teapot/Bot/Brain.pm +++ b/lib/Teapot/Bot/Brain.pm @@ -448,7 +448,15 @@ sub _process_message { foreach my $listener (@{ $self->listeners }) { # call the listener code, supplying ourself and the update - $listener->($self, $update); + my $evalRet = eval { + $listener->($self, $update); + return 1; + }; + + unless ($evalRet) { + cluck "An error occured during update processing: $EVAL_ERROR"; + return; + } } return;