[Bast-commits] r9396 - DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage

tonvoon at dev.catalyst.perl.org tonvoon at dev.catalyst.perl.org
Mon May 17 12:52:28 GMT 2010


Author: tonvoon
Date: 2010-05-17 13:52:28 +0100 (Mon, 17 May 2010)
New Revision: 9396

Modified:
   DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage/DBI.pm
Log:
Fix missing $@ in try::tiny conversion


Modified: DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage/DBI.pm	2010-05-17 12:15:00 UTC (rev 9395)
+++ DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage/DBI.pm	2010-05-17 12:52:28 UTC (rev 9396)
@@ -1177,7 +1177,7 @@
     $DBI::connect_via = 'connect';
   }
 
-  my $caught;
+  my $exception;
   try {
     if(ref $info[0] eq 'CODE') {
        $dbh = $info[0]->();
@@ -1204,13 +1204,13 @@
       $dbh->{PrintError} = 0;
     }
   } catch {
-    $caught = 1;
+    $exception = $_;
   };
 
   $DBI::connect_via = $old_connect_via if $old_connect_via;
 
-  $self->throw_exception("DBI Connection failed: " . ($@||$DBI::errstr))
-    if !$dbh || $caught;
+  $self->throw_exception("DBI Connection failed: " . ((defined $exception && $exception) || $DBI::errstr))
+    if !$dbh || defined $exception;
 
   $self->_dbh_autocommit($dbh->{AutoCommit});
 




More information about the Bast-commits mailing list