-
-
21 Jun 2001 04:30:54 UTC
- Distribution: Concurrent-Object
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (82 / 116 / 1)
- Kwalitee
Bus factor: 1- % Coverage
- License: unknown
- Activity
24 month- Tools
- Download (10.15KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Concurrent::Errorhandler - Error handling mechanism for Concurrent.
SYNOPSIS
package Foo; use Concurrent::Errorhandler; @ISA = qw(Concurrent::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
Concurrent::Errorhandler encapsulates the error handling mechanism used by the modules in Concurrent bundle. Concurrent::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 undef 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 never 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
- error($mesage, ($wipeme, $wipemetoo))
-
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.
- errstr()
-
errstr() is an accessor method for $self->{errstr}.
AUTHOR
Vipul Ved Prakash, <mail@vipul.net>
SEE ALSO
Concurrent(3)
Module Install Instructions
To install Concurrent::Object, copy and paste the appropriate command in to your terminal.
cpanm Concurrent::Object
perl -MCPAN -e shell install Concurrent::Object
For more information on module installation, please visit the detailed CPAN module installation guide.