neven error/messaging changes

Bryan Dumm bdumm at bobby.bcpub.com
Thu Jan 4 03:21:55 PST 2001


> About that error stuff...
>
> I implemented _some_ error checking in _a few_ subroutines.
> It's not much and it's there just for as an example.
>
> It looks like:
>
>         if (! chdir $dir) {
>                 return if error($elt, "Unable to change directory to
> $dir.\n"); }
>
> which is similar to what you proposed in one of your messages.
>
> But I'll send you the code soon, so you can see it yourself.

Yea what I was thinking is from webmin 

error(message) This function is typically used by CGI programs that process 
the input from a form, to inform the user of invalid input or some processing 
error. It assumes that a global variable called $whatfailed contains the 
first part of the error message, with the parameter being the rest. For 
example :

$whatfailed = "Failed to save user";
if (!$in{'name'}) { &error("Missing username"); }
if ($in{'name'} =~ /a/) { &error("'$in{'name'}' is not a valid username"); }

dunno if any of this would be more useful or not... I might have more 
comments after doing more merging of the code today....

Bryan





More information about the alfs-discuss mailing list