cvsserver: Abort if connect to database fails
Currently all calls to the database backend make no error checking or handling at all. At least abort if the connection to the database failed since there is really no way we could do anything useful after that. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Frank Lichtenheld committed
Mar 19, 2007 at 16:56 UTC
920a449af5a6b4ecbf01a5a4e3bc4894ad302634
1 file changed
+1
git-cvsserver.perl
+1
@@ -2168,6 +2168,7 @@ sub new
2168
$self->{dbh} = DBI->connect("$self->{dbdriver}:dbname=$self->{dbname}",
2169
$self->{dbuser},
2170
$self->{dbpass});
2171
+ die "Error connecting to database\n" unless defined $self->{dbh};
2172
2173
$self->{tables} = {};
2174
foreach my $table ( $self->{dbh}->tables )