aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Plugin.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/Plugin.pm b/Plugin.pm
index 1f3d080..6714987 100644
--- a/Plugin.pm
+++ b/Plugin.pm
@@ -17,12 +17,18 @@ sub load_plugin {
eval {
require $path . ".pm";
- push @{$config->{active_plugins}}, $module;
} or do {
chomp $@;
$logger->($@);
return "Cannot load $module: $!";
};
+
+ if (not $module->can("configure")) {
+ $logger->("Loaded $module but it can't be configured. Probably not a module for us");
+ return "Can't configure $module. It probably isn't a module for me. Unloaded it.";
+ }
+
+ push @{$config->{active_plugins}}, $module;
$load_callback->($module);
return undef;
}