Logan Bell > Lucy-0.3.2 > Lucy::Object::Err

Download:
Lucy-0.3.2.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.003002   Source   Latest Release: Lucy-0.3.3

NAME ^

Lucy::Object::Err - Exception.

SYNOPSIS ^

    use Scalar::Util qw( blessed );
    my $bg_merger;
    while (1) {
        $bg_merger = eval {
            Lucy::Index::BackgroundMerger->new( index => $index );
        };
        last if $bg_merger;
        if ( blessed($@) and $@->isa("Lucy::Store::LockErr") ) {
            warn "Retrying...\n";
        }
        else {
            # Re-throw.
            die "Failed to open BackgroundMerger: $@";
        }
    }

DESCRIPTION ^

Most of the time when Lucy encounters an error, it tries to raise a Lucy::Object::Err exception with an error message and context information.

At present, it is only safe to catch exceptions which are specifically documented as catchable; most times when an Err is raised, Lucy leaks memory.

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.

INHERITANCE ^

Lucy::Object::Err isa Lucy::Object::Obj.

syntax highlighting: