Class::ErrorHandler man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Class::ErrorHandler(3)User Contributed Perl DocumentatioClass::ErrorHandler(3)

NAME
       Class::ErrorHandler - Base class for error handling

SYNOPSIS
	   package Foo;
	   use base qw( Class::ErrorHandler );

	   sub class_method {
	       my $class = shift;
	       ...
	       return $class->error("Help!")
		   unless $continue;
	   }

	   sub object_method {
	       my $obj = shift;
	       ...
	       return $obj->error("I am no more")
		   unless $continue;
	   }

	   package main;
	   use Foo;

	   Foo->class_method or die Foo->errstr;

	   my $foo = Foo->new;
	   $foo->object_method or die $foo->errstr;

DESCRIPTION
       Class::ErrorHandler provides an error-handling mechanism that's generic
       enough to be used as the base class for a variety of OO classes.
       Subclasses inherit its two error-handling methods, error and errstr, to
       communicate error messages back to the calling program.

       On failure (for whatever reason), a subclass should call error and
       return to the caller; error itself sets the error message internally,
       then returns "undef". This has the effect of the method that failed
       returning "undef" to the caller. The caller should check for errors by
       checking for a return value of "undef", and calling errstr to get the
       value of the error message on an error.

       As demonstrated in the SYNOPSIS, error and errstr work as both class
       methods and object methods.

USAGE
   Class->error($message)
   $object->error($message)
       Sets the error message for either the class Class or the object $object
       to the message $message. Returns "undef".

   Class->errstr
   $object->errstr
       Accesses the last error message set in the class Class or the object
       $object, respectively, and returns that error message.

LICENSE
       Class::ErrorHandler is free software; you may redistribute it and/or
       modify it under the same terms as Perl itself.

AUTHOR & COPYRIGHT
       Except where otherwise noted, Class::ErrorHandler is Copyright 2004
       Benjamin Trott, cpan@stupidfool.org. All rights reserved.

perl v5.14.0			  2004-08-15		Class::ErrorHandler(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net