From: Brandon L. Black Date: Mon, 20 Feb 2006 02:46:16 +0000 (+0000) Subject: croak on DBI->connect errors X-Git-Tag: v0.06000~61^2~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e571e8237fd49d3d5b3772c951d3067a114bd6ac;p=dbsrgits%2FDBIx-Class.git croak on DBI->connect errors --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 578735e..2143463 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -299,7 +299,10 @@ sub _connect { return $dbh; } - DBI->connect(@info); + my $dbh = DBI->connect(@info); + croak "DBI Connection failed: $DBI::errstr" + unless $dbh; + $dbh; } =head2 txn_begin