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


Manual Reference Pages  -  RAZOR2::ERRORHANDLER (3)

.ds Aq ’

NAME

Razor::Errorhandler - Error handling mechanism for Razor.

CONTENTS

SYNOPSIS



    package Foo;

    use Razor::Errorhandler;
    @ISA = qw(Razor::Errorhandler);

    sub alive {
        ..
        ..
        return
        $self->error ("Awake, awake! Ring the alarum bell. \
                       Murther and treason!", $dagger)
            if $self->murdered($king);
    }


    package main;

    use Foo;
    my $foo = new Foo;
    $foo->alive($king) or print $foo->errstr();
    # prints "Awake, awake! ... "



DESCRIPTION

Razor::Errorhandler encapsulates the error handling mechanism used by the modules in Razor bundle. Razor::Errorhandler doesn’t have a constructor and is meant to be inherited. The derived modules use its two methods, error() and errstr(), to communicate error messages to the caller.

When a method of the derived module fails, it calls $self->error() and returns to the caller. The error message passed to error() is made available to the caller through the errstr() accessor. error() also accepts a list of sensitive data that it wipes out (undef’es) before returning.

The caller should <B>neverB> call errstr() to check for errors. errstr() should be called only when a method indicates (usually through an undef return value) that an error has occured. This is because errstr() is never overwritten and will always contain a value after the occurance of first error.

METHODS

<B>error($mesage, ($wipeme, B>$wipemetoo<B>))B> The first argument to error() is $message which is placed in $self->{errstr} and the remaining arguments are interpretted as variables containing sensitive data that are wiped out from the memory. error() always returns undef.
<B>B>errstr()<B>B> errstr() is an accessor method for $self->{errstr}.

AUTHOR

Vipul Ved Prakash, <mail@vipul.net>

SEE ALSO

Razor::Client(3)
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 RAZOR2::ERRORHANDLER (3) 2016-04-03

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