croak on DBI->connect errors
Brandon L. Black [Mon, 20 Feb 2006 02:46:16 +0000 (02:46 +0000)]
lib/DBIx/Class/Storage/DBI.pm

index 578735e..2143463 100644 (file)
@@ -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