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 0.563 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )