This project has retired. For details please refer to its Attic page.
Clownfish::Err – Apache Clownfish Documentation
Apache Lucy™

NAME

Clownfish::Err - Exception.

SYNOPSIS

package MyErr;
use base qw( Clownfish::Err );

...

package main;
use Scalar::Util qw( blessed );
while (1) {
    eval {
        do_stuff() or MyErr->throw("retry");
    };
    if ( blessed($@) and $@->isa("MyErr") ) {
        warn "Retrying...\n";
    }
    else {
        # Re-throw.
        die "do_stuff() died: $@";
    }
}

DESCRIPTION

Clownfish::Err is the base class for exceptions in the Clownfish object hierarchy.

The Err module also provides access to a per-thread Err shared variable via set_error() and get_error(). It may be used to store an Err object temporarily, so that calling code may choose how to handle a particular error condition.

METHODS

cat_mess

$err->cat_mess($mess);

Concatenate the supplied argument onto the error message.

get_mess

my $string = $err->get_mess();

Return the error message.

INHERITANCE

Clownfish::Err isa Clownfish::Obj.