I guess ensure_connected does not have a return value... so I cannot use it. Fix...
John Napiorkowski [Wed, 18 Feb 2009 19:35:19 +0000 (19:35 +0000)]
lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm

index 833ffad..76ca7f2 100644 (file)
@@ -187,17 +187,19 @@ bringing down your entire pool of databases.
 
 sub _safely_ensure_connected {
   my ($self, $replicant, @args) = @_;
-  my $return; eval {
-    $return = $replicant->ensure_connected(@args);
-  }; if ($@) {
+  eval {
+    $replicant->ensure_connected(@args);
+  }; 
+  if ($@) {
     $replicant
-        ->debugobj
-        ->print(
-            sprintf( "Exception trying to ->ensure_connected for replicant %s, error is %s",
-                $self->_dbi_connect_info->[0], $@)
+      ->debugobj
+      ->print(
+        sprintf( "Exception trying to ->ensure_connected for replicant %s, error is %s",
+          $replicant->_dbi_connect_info->[0], $@)
         );
+       return;
   }
-  return $return;
+  return 1;
 }
 
 =head2 connected_replicants