::Storage::DBI::_server_info was eating connection exceptions by
ignoring exceptions from $dbh->get_info, but this information is
important for _rebless when e.g. determining which class to use based on
the DB server version, so rethrow the exceptions when
$self->{_in_determine_driver} is true.
$info = {};
- my $server_version = try { $self->_get_server_version };
+ my $server_version;
+ try {
+ $server_version = $self->_get_server_version;
+ }
+ catch {
+ if ($self->{_in_determine_driver}) {
+ $self->throw_exception($_);
+ }
+ $server_version = undef;
+ };
if (defined $server_version) {
$info->{dbms_version} = $server_version;
unless defined $info;
}
- return try { $self->_get_dbh->get_info($info) } || undef;
+ my $res;
+
+ try {
+ $res = $self->_get_dbh->get_info($info);
+ }
+ catch {
+ if ($self->{_in_determine_driver}) {
+ $self->throw_exception($_);
+ }
+ $res = undef;
+ };
+
+ return $res;
}
sub _determine_driver {