report error on failure to load a plugin

This commit is contained in:
Oliver Gorwits
2013-03-10 18:41:40 +00:00
parent af8f124bb2
commit 00265a9323
2 changed files with 3 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ sub _load_web_plugins {
debug "loading Netdisco plugin $plugin"; debug "loading Netdisco plugin $plugin";
eval "require $plugin"; eval "require $plugin";
error $@ if $@;
} }
} }

View File

@@ -84,7 +84,7 @@ register 'register_report' => sub {
my @categories = @{ setting('report_order') }; my @categories = @{ setting('report_order') };
if (!length $config->{category} if (!length $config->{category}
or !length $config->{path} or !length $config->{tag}
or !length $config->{label} or !length $config->{label}
or 0 == scalar grep {$config->{category} eq $_} @categories) { or 0 == scalar grep {$config->{category} eq $_} @categories) {
@@ -93,7 +93,7 @@ register 'register_report' => sub {
} }
foreach my $item (@{setting('reports')->{ $config->{category} }}) { foreach my $item (@{setting('reports')->{ $config->{category} }}) {
if ($item->{label} eq $config->{label}) { if ($item->{tag} eq $config->{tag}) {
$item = $config; $item = $config;
return; return;
} }