
Die::Hard - objects as resistant to dying as John Maclane

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!

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.
new(%attributes)Standard Moose-style constructor.
new($object)Shortcut for setting the proxy_for attribute.
proxy_forThe object being wrapped. Read-only; required.
last_errorIf the last proxied method call died, then this attribute will contain the error. Otherwise will be false (undef or empty string).

Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=Die-Hard.


Toby Inkster <tobyink@cpan.org>.

This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.