X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FReplicated.pm;h=512c53e0b09f1c616d992b5385e87f29a29f86e8;hb=67cbc0a817;hp=73998d2e7a07aa607b8e2cb6da41c3d84f7c1ac1;hpb=b4976ee31c2f188f9aa8f226a3155bf15a7da36b;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Replicated.pm b/lib/DBIx/Class/Storage/DBI/Replicated.pm index 73998d2..512c53e 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated.pm @@ -693,19 +693,13 @@ sub execute_reliably { my $self = shift; my $coderef = shift; - unless( ref $coderef eq 'CODE') { - $self->throw_exception('Second argument must be a coderef'); - } + $self->throw_exception('Second argument must be a coderef') + unless( ref $coderef eq 'CODE'); ## replace the current read handler for the remainder of the scope local $self->{read_handler} = $self->master; - my $args = \@_; - return dbic_internal_try { - $coderef->(@$args); - } catch { - $self->throw_exception("coderef returned an error: $_"); - }; + &$coderef; } =head2 set_reliable_storage