Bio-Genex
view release on metacpan or search on metacpan
DBUtils/DBUtils.pm.in view on Meta::CPAN
Bio::Genex::Connect, otherwise it triggers an exception.
=cut
sub assert_dbh {
my $dbh = shift;
return if ref($dbh) && $dbh->isa('Bio::Genex::Connect');
# Oops, someone blew it, give them a useful error message
# first figure out who called us
my @caller = caller(1);
my $subroutine = $caller[3];
if (ref($dbh) && $dbh->isa('DBI::db')) {
croak "Invalid DB handle. Cannot use DBI::connect()\nto create a DB handle for $subroutine,\nmust create DB handle using Bio::Genex::current_connection() or Bio::Genex::_connect()";
} else {
croak "$subroutine expected a database handle, but got: '$dbh'";
}
}
=item assert_table_defined($dbh,$table_name)
( run in 0.296 second using v1.01-cache-2.11-cpan-0d8aa00de5b )