GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Crypt::OpenPGP::ErrorHandler(3) User Contributed Perl Documentation Crypt::OpenPGP::ErrorHandler(3)

Crypt::OpenPGP::ErrorHandler - Crypt::OpenPGP error handling

    package Foo;
    use Crypt::OpenPGP::ErrorHandler;
    use base qw( Crypt::OpenPGP::ErrorHandler );

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

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

    package main;

    Foo->class_method or die Foo->errstr;

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

Crypt::OpenPGP::ErrorHandler provides an error-handling mechanism for all Crypt::OpenPGP modules/classes. It is meant to be used as a base class for classes that wish to use its error-handling methods: derived classes use its two 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 in this case should call errstr to get the value of the error message. Note that calling errstr when an error has not occurred is undefined behavior and will rarely do what you want.

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

Sets the error message for either the class Class or the object $object to the message $message. Returns "undef".

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

Please see the Crypt::OpenPGP manpage for author, copyright, and license information.
2015-08-16 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.