Skip to content
Browse files

Better error handling when DB connections fail

git-svn-id: http://svn.php.net/repository/pear/pearweb/trunk@313972 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent a9f1295 commit a2a1053f96a000e0138255c61e69b30fc61847d7 @CloCkWeRX CloCkWeRX committed Jul 30, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 cron/apidoc-queue.php
View
6 cron/apidoc-queue.php
@@ -101,8 +101,10 @@ function _postProcessValidPackagexml(&$pf)
'persistent' => false,
'portability' => DB_PORTABILITY_ALL,
);
-$dbh =& DB::connect(PEAR_DATABASE_DSN, $options);
-
+$dbh = DB::connect(PEAR_DATABASE_DSN, $options);
+if (PEAR::isError($dbh)) {
+ die($dbh->getMessage());
+}
$query = "SELECT filename FROM apidoc_queue WHERE finished = '0000-00-00 00:00:00'";
$rows = $dbh->getCol($query);

0 comments on commit a2a1053

Please sign in to comment.
Something went wrong with that request. Please try again.