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

tonvoon at dev.catalyst.perl.org tonvoon at dev.catalyst.perl.org
Fri May 14 22:22:57 GMT 2010


Author: tonvoon
Date: 2010-05-14 23:22:57 +0100 (Fri, 14 May 2010)
New Revision: 9376

Modified:
   DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage/DBI.pm
Log:
Another eval => try


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-14 22:03:03 UTC (rev 9375)
+++ DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage/DBI.pm	2010-05-14 22:22:57 UTC (rev 9376)
@@ -1714,20 +1714,25 @@
 sub _dbh_execute_inserts_with_no_binds {
   my ($self, $sth, $count) = @_;
 
-  eval {
+  my $exception;
+  try {
     my $dbh = $self->_get_dbh;
     local $dbh->{RaiseError} = 1;
     local $dbh->{PrintError} = 0;
 
     $sth->execute foreach 1..$count;
+  } catch {
+    $exception = shift;
   };
-  my $exception = $@;
 
 # Make sure statement is finished even if there was an exception.
-  eval { $sth->finish };
-  $exception = $@ unless $exception;
+  try { 
+    $sth->finish 
+  } catch {
+    $exception = shift unless defined $exception;
+  };
 
-  $self->throw_exception($exception) if $exception;
+  $self->throw_exception($exception) if defined $exception;
 
   return $count;
 }




More information about the Bast-commits mailing list