++ed by:
JETEVE
2 non-PAUSE users
Author image Nick Wellnhofer
and 1 contributors

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.