Aniki

 view release on metacpan or  search on metacpan

t/lib/t/DB/Exception.pm  view on Meta::CPAN

package t::DB::Exception;
use strict;
use warnings;

use Scalar::Util qw/blessed/;

sub new {
    my $class = shift;
    return bless {@_} => $class;
}

sub message { shift->{message} }

sub throw { die shift->new(@_) }

sub caught {
    my ($class, $e) = @_;
    return blessed $e && $e->isa($class);
}

1;
__END__

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.138 second using v1.00-cache-1.14-grep-28634ff-cpan-ac32402124b )