X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FODBC.pm;h=98ca586eb7f3de8a15e2cd159881fe01d72640b4;hp=f8e92098ac425b9260bc110fbca8dae102d82b79;hb=ed7ab0f4ce1a9118ea6285ee562ef003085a6b64;hpb=7803e57ad8daee28020676140ea6894c31e3112e diff --git a/lib/DBIx/Class/Storage/DBI/ODBC.pm b/lib/DBIx/Class/Storage/DBI/ODBC.pm index f8e9209..98ca586 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC.pm @@ -4,13 +4,17 @@ use warnings; use base qw/DBIx::Class::Storage::DBI/; use mro 'c3'; +use Try::Tiny; sub _rebless { my ($self) = @_; - my $dbtype = eval { $self->_get_dbh->get_info(17) }; + my $caught; + my $dbtype; + try { $self->_get_dbh->get_info(17) } + catch { $caught = 1 }; - unless ( $@ ) { + unless ( $caught ) { # Translate the backend name into a perl identifier $dbtype =~ s/\W/_/gi; my $subclass = "DBIx::Class::Storage::DBI::ODBC::${dbtype}";