All expected evals converted to try, except where no test is done,
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / InterBase.pm
index a0f934a..db1021a 100644 (file)
@@ -5,6 +5,7 @@ use warnings;
 use base qw/DBIx::Class::Storage::DBI/;
 use mro 'c3';
 use List::Util();
+use Try::Tiny;
 
 =head1 NAME
 
@@ -125,11 +126,14 @@ sub _ping {
   local $dbh->{RaiseError} = 1;
   local $dbh->{PrintError} = 0;
 
-  eval {
+  my $rc = 1;
+  try {
     $dbh->do('select 1 from rdb$database');
+  } catch {
+    $rc = 0;
   };
 
-  return $@ ? 0 : 1;
+  return $rc;
 }
 
 # We want dialect 3 for new features and quoting to work, DBD::InterBase uses