Skip to content

Commit

Permalink
cvsserver: Abort if connect to database fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frank Lichtenheld authored and Junio C Hamano committed Mar 22, 2007
1 parent eb1780d commit 920a449
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions git-cvsserver.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2168,6 +2168,7 @@ sub new
$self->{dbh} = DBI->connect("$self->{dbdriver}:dbname=$self->{dbname}",
$self->{dbuser},
$self->{dbpass});
die "Error connecting to database\n" unless defined $self->{dbh};

$self->{tables} = {};
foreach my $table ( $self->{dbh}->tables )
Expand Down

0 comments on commit 920a449

Please sign in to comment.