cvs: php4 /pear/DB pgsql.php

From: Date: Mon, 09 Jul 2001 00:16:37 +0000
Subject: cvs: php4 /pear/DB pgsql.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-245@lists.php.net to get a copy of this message
cox Sun Jul 8 20:16:37 2001 EDT Modified files: /php4/pear/DB pgsql.php Log: catch and report the native error in connect Index: php4/pear/DB/pgsql.php diff -u php4/pear/DB/pgsql.php:1.38 php4/pear/DB/pgsql.php:1.39 --- php4/pear/DB/pgsql.php:1.38 Wed Apr 18 22:37:47 2001 +++ php4/pear/DB/pgsql.php Sun Jul 8 20:16:34 2001 @@ -109,10 +109,14 @@ } $connect_function = $persistent ? 'pg_pconnect' : 'pg_connect'; - - $conn = @$connect_function($connstr); + // catch error + ob_start(); + $conn = $connect_function($connstr); + $error = ob_get_contents(); + ob_end_clean(); if ($conn == false) { - return $this->raiseError(DB_ERROR_CONNECT_FAILED); + return $this->raiseError(DB_ERROR_CONNECT_FAILED, null, + null, null, strip_tags($error)); } $this->connection = $conn; return DB_OK;

« previous php.pear.cvs (#245) next »