} else {
local $Phase = 'RP';
- if (ref $@) {
- # Processing explicitly threw an exception
- my $E = $@; # preserve the exception, since many functions use eval
+ my $E = $@; # preserve the exception, since many functions use eval
- unless ($oplist) {
- # The directive text is emailed immediately after $oplist is set,
- # so if $oplist is not set, then we still need to send it. Do so now.
- mail($directive_text,0,'debug: directive file contents')
- if $directive_text && DEBUG;
- }
+ unless ($oplist) {
+ # The directive text is emailed immediately after $oplist is set,
+ # so if $oplist is not set, then we still need to send it. Do so now.
+ mail($directive_text,0,'debug: directive file contents')
+ if $directive_text && DEBUG;
+ }
+ if (ref $E) {
+ # Processing explicitly threw an exception
if ($E->type_p('directive_syntax')) {
mail(join("\n",$E->summary,'',$E->trace_msg),1);
} elsif ($E->type_p('package_configuration')) {
# exceptions thrown using die, used to reflect system errors like
# failures of commands or operations that we know should succeed,
# such as opening a file that we already know exists.
- warn "error during processing: $@";
+ warn "error during processing: $E";
}
# clean up files if we abort while processing a triplet