X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=fdfd16e60235b6510f203df26ba18be7b967749a;hb=0c11ad0ee5c8407f6b87d6e15c62a1b445076dc0;hp=3af080540dabdf81f10bc4b16bfc725e846faee6;hpb=218b7c12fa60ffdd37000b73b8ebca4c9d91a8a2;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 3af0805..fdfd16e 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1078,15 +1078,15 @@ sub _server_info { $info = {}; - my $server_version; - try { - $server_version = $self->_get_server_version; - } - catch { - if ($self->{_in_determine_driver}) { - $self->throw_exception($_); - } - $server_version = undef; + my $server_version = try { + $self->_get_server_version + } catch { + # driver determination *may* use this codepath + # in which case we must rethrow + $self->throw_exception($_) if $self->{_in_determine_driver}; + + # $server_version on failure + undef; }; if (defined $server_version) { @@ -1131,19 +1131,7 @@ sub _dbh_get_info { unless defined $info; } - my $res; - - try { - $res = $self->_get_dbh->get_info($info); - } - catch { - if ($self->{_in_determine_driver}) { - $self->throw_exception($_); - } - $res = undef; - }; - - return $res; + return $self->_get_dbh->get_info($info); } sub _describe_connection { @@ -3122,11 +3110,9 @@ cases if you choose the C<< AutoCommit => 0 >> path, just as you would be with raw DBI. -=head1 AUTHORS - -Matt S. Trout +=head1 AUTHOR AND CONTRIBUTORS -Andy Grundman +See L and L in DBIx::Class =head1 LICENSE