From 4eca1f9cc8fa41413682ea970300e33d70a761df Mon Sep 17 00:00:00 2001 From: fukachan Date: Tue, 2 Jul 2002 12:38:06 +0000 Subject: check the existence of summary_file send back the error message --- fml/lib/FML/Command/User/summary.pm | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/fml/lib/FML/Command/User/summary.pm b/fml/lib/FML/Command/User/summary.pm index 28ad3154..f7e938c9 100644 --- a/fml/lib/FML/Command/User/summary.pm +++ b/fml/lib/FML/Command/User/summary.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: summary.pm,v 1.7 2002/04/06 14:46:28 fukachan Exp $ +# $FML: summary.pm,v 1.8 2002/04/07 12:07:34 fukachan Exp $ # package FML::Command::User::summary; @@ -63,10 +63,20 @@ sub need_lock { 1;} sub process { my ($self, $curproc, $command_args) = @_; - my $config = $curproc->{ config }; - - $command_args->{ _filepath_to_send } = $config->{ "summary_file" }; - $self->send_file($curproc, $command_args); + my $config = $curproc->{ config }; + my $summary_file = $config->{ "summary_file" }; + + if (-f $summary_file) { + $command_args->{ _filepath_to_send } = $summary_file; + $self->send_file($curproc, $command_args); + } + else { + $curproc->reply_message_nl('error.no_such_file', + 'summary not found', + { + _arg_file => 'summary', + }); + } } -- cgit v1.2.1