sub package_name { (shift)->{package_name} }
}
+{
+ package Local::Exception::directive_filename_mismatch;
+ {our @ISA = qw(Local::Exception)}
+
+ sub summary {
+ my $self = shift;
+ return "filename element mismatch: $self->{filename} expecting $self->{stem}"}
+
+ sub message { my $self = shift; return <<"END" }
+The filename directive element does not match the name of the uploaded file.
+
+ Declared name: $self->{filename}
+ Uploaded file: $self->{stem}
+END
+}
+
{
package Local::Exception::directive_syntax;
{our @ISA = qw(Local::Exception)}
# directive signature and the uploaded packet. We already know that
# the name of the uploaded file must match the stem of the directive
# file name; this is how it was recognized as part of the packet.
- fatal("The filename directive does not match name of the uploaded file."
- ."\n\n Filename directive: $op_header->{filename}"
- ."\n Uploaded file: $stem\n",1)
- unless $stem eq $op_header->{filename};
+ throw directive_filename_mismatch =>
+ filename => $op_header->{filename}, stem => $stem
+ unless $stem eq $op_header->{filename};
}
}
mail(join("\n",$E->summary,'',$E->trace_msg),1);
} elsif ($E->type_p('package_configuration')) {
mail($E->summary,0);
- } elsif ($E->type_p('signature_replay')
- || $E->type_p('unknown_package')) {
+ } elsif (UNIVERSAL::can($E, 'message')) {
+ # catch-all for exceptions carrying long-form messages
mail($E->message,1);
}
} else {
exp_continue
}
-re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\
- The filename directive does not match name of the\
- uploaded file.[^\r\n]+} {
+ filename element mismatch: [^\r\n]+} {
# from read_directive_file, on name mismatch
set A(validate,filename-mismatch) 1
exp_continue
}
- -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\
- filename [^\r\n]+ does not match name of directive[^\r\n]+} {
- # from read_directive_file, on name mismatch
- set A(validate,filename-mismatch-directive) 1
- exp_continue
- }
-re {^gatekeeper\[[0-9]+\]: \(Test\) \[AA\]\
DEBUG: Signature made [^\r\n]+} {
# from read_directive_file, reporting signature timestamp