perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: BSD::Resource needed on BSD systems
Date Wed, 05 Jan 2005 16:07:08 GMT
Perrin Harkins wrote:
> On Wed, 2005-01-05 at 10:43 -0500, Stas Bekman wrote:
> 
>>Perrin Harkins wrote:
>>
>>>I can standardize these messages if it will help.
>>
>>What do you mean? Patch?

> Index: SizeLimit.pm
> ===================================================================
> --- SizeLimit.pm	(revision 124221)
> +++ SizeLimit.pm	(working copy)
> @@ -16,6 +16,7 @@
>  
>  use strict;
>  use warnings FATAL => 'all';
> +use Carp qw(croak);
>  
>  use mod_perl 1.99;
>  
> @@ -46,7 +47,7 @@
>  
>  BEGIN {
>  
> -    die "Apache::SizeLimit at the moment works only with non-threaded
> MPMs"
> +    croak "Apache::SizeLimit at the moment works only with non-threaded
> MPMs"
>          if Apache::MPM->is_threaded();
>  
>      # decide at compile time how to check for a process' memory size.
> @@ -64,8 +65,8 @@
>          if ( eval { require BSD::Resource } ) {
>              $HOW_BIG_IS_IT = \&bsd_size_check;
>          } else {
> -            die "you must install BSD::Resource for Apache::SizeLimit
> " .
> -                "to work on your platform.";
> +            croak "Unsupported platform: you must install BSD::Resource
> " .
> +	          "for Apache::SizeLimit to work on your platform.";
>          }

that's misleading. The platform is supported. I see nothing wrong with 
having different error messages. How about:

"Missing prerequisite: BSD::Resource"

>  #  Currently unsupported for mp2 because of threads...
> @@ -74,13 +75,14 @@
>  #         if ( eval { require Win32::API } ) {
>  #             $HOW_BIG_IS_IT = \&win32_size_check;
>  #         } else {
> -#             die "you must install Win32::API for Apache::SizeLimit
> " .
> -#                 "to work on your platform.";
> +#             croak "Unsupported platform: you must install Win32::API
> "
> +#                   "for Apache::SizeLimit to work on your platform.";
>  #         }

same here.

>      } else {
>  
> -        die "Apache::SizeLimit not implemented on $^O";
> +        croak "Unsupported platform: Apache::SizeLimit not implemented
> " .
> +	      "on $^O";

How about just:

   croak "Unsupported platform: $^O";


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message