The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Haver::Protocol::Errors - Error routines and data.

SYNOPSIS

   use Haver::Protocol::Errors qw(%Errors);
   my ($short_desc, $long_desc) = @{ $Errors{ UID_NOT_FOUND } };

   # or
   $short_desc = Haver::Protocol::Errors->get_short_desc('UCMD');
   $long_desc  = Haver::Protocol::Errors->get_long_desc('UCMD');

   # Formatting:
   $s = Haver::Protocol::Errors->format($Errors{$err}[1], $arg1);
 

DESCRIPTION

This is a class for turning Haver error codes into human-readable strings.

METHODS

my $e = new Haver::Protocol::Errors

This doesn't actually make a new object. it just returns "Haver::Protocol::Errors". This is because this module only provides class methods. But I'm lazy and want to write $e here instead of Haver::Protocol::Errors.

$s = $e->short_desc($err)

$s is short string describing the error $err.

$s = $e->long_desc($err)

$s is a longer string. It will contain "#n", where n is a nonzero number. You will want to pass $s to $s->format().

$s = $e->format( $e->long_desc($err) )

This $s can be presented to the user. It should be fairly easy to understand and such.

$s = $e->dump_errors()

$s is a string comtaining all errors. The format is:

Error code (tab) short_desc (tab) long_desc (tab) [comma-seperated list of descriptions of #-interpolations] NEWLINE [...]

SEE ALSO

Haver::Protocol.

https://savannah.nongnu.org/projects/haver/, http://wiki.chani3.com/wiki/ProjectHaver/Protocol, http://wiki.chani3.com/wiki/ProjectHaver/ProtocolSyntax.

AUTHOR

Dylan William Hardison, <dylanwh@tampabay.rr.com>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Dylan William Hardison

This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA