[Bast-commits] r9375 -
DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage
tonvoon at dev.catalyst.perl.org
tonvoon at dev.catalyst.perl.org
Fri May 14 22:03:03 GMT 2010
Author: tonvoon
Date: 2010-05-14 23:03:03 +0100 (Fri, 14 May 2010)
New Revision: 9375
Modified:
DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage/DBI.pm
Log:
Add eval => try
Modified: DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage/DBI.pm 2010-05-14 22:02:41 UTC (rev 9374)
+++ DBIx-Class/0.08/branches/try-tiny/lib/DBIx/Class/Storage/DBI.pm 2010-05-14 22:03:03 UTC (rev 9375)
@@ -1014,7 +1014,7 @@
my $server_version = do {
local $@; # might be happenin in some sort of destructor
- eval { $self->_get_server_version };
+ try { $self->_get_server_version };
};
if (defined $server_version) {
@@ -1172,7 +1172,8 @@
$DBI::connect_via = 'connect';
}
- eval {
+ my $caught;
+ try {
if(ref $info[0] eq 'CODE') {
$dbh = $info[0]->();
}
@@ -1197,12 +1198,14 @@
$dbh->{RaiseError} = 1;
$dbh->{PrintError} = 0;
}
+ } catch {
+ $caught = 1;
};
$DBI::connect_via = $old_connect_via if $old_connect_via;
$self->throw_exception("DBI Connection failed: " . ($@||$DBI::errstr))
- if !$dbh || $@;
+ if !$dbh || $caught;
$self->_dbh_autocommit($dbh->{AutoCommit});
More information about the Bast-commits
mailing list