Unverified Commit 1e03bf82 authored by Stefan Hornburg (Racke)'s avatar Stefan Hornburg (Racke)
Browse files

Prevent Sympa daemon crash due to a broken plugin module.

parent fe59ff55
......@@ -95,6 +95,9 @@ requires 'List::Util::XS', '>= 1.20';
# Note: 1.22 or later is recommended.
requires 'Locale::Messages', '>= 1.20';
# Used to load plugins
requires 'Module::Runtime';
# MHonArc is used to build Sympa web archives
requires 'MHonArc::UTF8';
......
......@@ -30,6 +30,7 @@ package Sympa::Message::Plugin;
use strict;
use warnings;
use English qw(-no_match_vars);
use Module::Runtime qw(use_module);
use Sympa::Log;
......@@ -58,8 +59,7 @@ sub execute {
unless $hook_module =~ /::/;
unless (exists $handlers{$hook_module . '->' . $hook_name}) {
eval "use $hook_module;";
if ($EVAL_ERROR) {
unless (eval { use_module($hook_module); 1; }) {
$log->syslog('err', 'Cannot load hook module %s: %s',
$hook_module, $EVAL_ERROR);
return undef;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment