You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Stas Bekman <st...@stason.org> on 2001/06/30 15:25:09 UTC

[patch] a more user friendly server failure report

As we see at the list, sometimes users have a problem to start the server
in the 'make test' stage and when they see:

  server failed to start! (please examine t/logs/error_log)

many times this log file doesn't exist. So let's check whether the file
exists before we suggest to look at this file. In case it doesn't exist we
should point to the debug resource. Since currently we don't have any
final SUPPORT doc, I wrote some blurb. later on we can replace with a
pointer to a doc that explains what to do.

Index: Apache-Test/lib/Apache/TestServer.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestServer.pm,v
retrieving revision 1.10
diff -b -u -r1.10 TestServer.pm
--- Apache-Test/lib/Apache/TestServer.pm        2001/06/24 14:47:44
1.10
+++ Apache-Test/lib/Apache/TestServer.pm        2001/06/30 13:09:58
@@ -228,7 +228,13 @@
 sub failed_msg {
     my $self = shift;
     my $log = $self->{config}->error_log(1);
-    error "@_ (please examine $log)";
+    my $log_file_info;
+    if (-e $log) {
+        $log_file_info = "please examine $log";
+    } else {
+        $log_file_info = "$log wasn't created, start the server in debug mode";
+    }
+    error "@_ ($log_file_info)";
 }

 sub start {




_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



Re: [patch] a more user friendly server failure report

Posted by Doug MacEachern <do...@covalent.net>.
On Sat, 30 Jun 2001, Stas Bekman wrote:

> 
> As we see at the list, sometimes users have a problem to start the server
> in the 'make test' stage and when they see:
> 
>   server failed to start! (please examine t/logs/error_log)
> 
> many times this log file doesn't exist. So let's check whether the file
> exists before we suggest to look at this file. In case it doesn't exist we
> should point to the debug resource. Since currently we don't have any
> final SUPPORT doc, I wrote some blurb. later on we can replace with a
> pointer to a doc that explains what to do.

looks good.  don't forget:
if () {
}
else {
}
not
if () {
} else {
}

this would be fine too:
my log_file_info = -e $log ? 
    "please examine $log" :
    "$log wasn't created, start the server in debug mode";