Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Abort daemon startup when required module is missing and clean up err…
…or output

Fix problem with eval $@ error result's scope in global Perl module
require routine. This was caused because logGlobal contains an eval
itself that overrides $@. Now when a "Require module Something::Special"
directive is issued and not satisfied, it is fatal as was originally
intended.

Remove logGlobal call that results in duplicate error output.

Correctly say "Aborting Interchange daemon" instead of "Aborting
catalog" when dying on global config errors.
  • Loading branch information
jonjensen committed Jun 27, 2009
1 parent bcf1ee9 commit 9f9d7c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Vend/Config.pm
Expand Up @@ -349,7 +349,6 @@ sub config_error {
warn "$msg\n" unless $Vend::Quiet;
}
else {
logGlobal({level => 'warn'}, $msg);
die "$msg\n";
}
}
Expand Down Expand Up @@ -2697,8 +2696,8 @@ sub parse_require {
}
else {
$carptype = \&config_error;
$error_message = 'Required %s %s not present. Aborting catalog.'
unless $error_message;
$error_message ||= 'Required %s %s not present. Aborting '
. ($C ? 'catalog' : 'Interchange daemon') . '.';
}

my $nostrict;
Expand Down Expand Up @@ -2768,11 +2767,12 @@ sub parse_require {
unshift(@INC, $pathinfo);
}
eval "require $module$oldtype;";
my $error = $@;
if ($pathinfo) {
shift(@INC);
}
::logGlobal("while eval'ing module %s got [%s]", $module, $@) if ($@);
return ! $@;
::logGlobal("while eval'ing module %s got [%s]\n", $module, $error) if $error;
return ! $error;
}
else {
# Since we aren't safe to actually require, we will
Expand Down

0 comments on commit 9f9d7c5

Please sign in to comment.