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%2FReplicated%2FPool.pm;h=76ca7f224d1cf2e63296e0d5aee9c91ff723be5e;hp=833ffad6ccf8d00cf30094a60591bed0565318f4;hb=6ffb5be522e752ea1ad2a99d36648535fe30a43b;hpb=506558685fcff08dee7bfdf5ab55b70f82d64818 diff --git a/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm b/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm index 833ffad..76ca7f2 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm @@ -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