Die-Hard
view release on metacpan or search on metacpan
SYNOPSIS
my $fragile = Fragile::Object->new;
my $diehard = Die::Hard->new($fragile);
$diehard->isa('Fragile::Object'); # true
$diehard->method_that_will_die; # lives!
$fragile->method_that_will_die; # dies!
DESCRIPTION
Die::Hard allows you to create fairly transparent wrapper object that
delegates all method calls through to the wrapped object, but does so
within an `eval { ... }` block. If the wrapped method call dies, then it
sets a `last_error` attribute.
Constructor
`new(%attributes)`
Standard Moose-style constructor.
`new($object)`
Shortcut for setting the `proxy_for` attribute.
lib/Die/Hard.pm view on Meta::CPAN
my $fragile = Fragile::Object->new;
my $diehard = Die::Hard->new($fragile);
$diehard->isa('Fragile::Object'); # true
$diehard->method_that_will_die; # lives!
$fragile->method_that_will_die; # dies!
=head1 DESCRIPTION
Die::Hard allows you to create fairly transparent wrapper object that
delegates all method calls through to the wrapped object, but does so
within an C<< eval { ... } >> block. If the wrapped method call dies,
then it sets a C<< last_error >> attribute.
=head2 Constructor
=over
=item C<< new(%attributes) >>
( run in 0.236 second using v1.01-cache-2.11-cpan-8780591d54d )