cvs: pear(MDB_1) /MDB/MDB Common.php
| From: | Lukas Smith | Date: | Fri, 12 Mar 2004 14:15:49 +0000 |
| Subject: | cvs: pear(MDB_1) /MDB/MDB Common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-17336@lists.php.net to get a copy of this message | ||
lsmith Fri Mar 12 09:15:49 2004 EDT
Modified files: (Branch: MDB_1)
/pear/MDB/MDB Common.php
Log:
ported improvements to raiseError from DB to better handle default error modes
http://cvs.php.net/diff.php/pear/MDB/MDB/Common.php?r1=1.114.4.17&r2=1.114.4.18&ty=u
Index: pear/MDB/MDB/Common.php
diff -u pear/MDB/MDB/Common.php:1.114.4.17 pear/MDB/MDB/Common.php:1.114.4.18
--- pear/MDB/MDB/Common.php:1.114.4.17 Wed Feb 18 05:28:25 2004
+++ pear/MDB/MDB/Common.php Fri Mar 12 09:15:47 2004
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@backendmedia.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Common.php,v 1.114.4.17 2004/02/18 10:28:25 quipo Exp $
+// $Id: Common.php,v 1.114.4.18 2004/03/12 14:15:47 lsmith Exp $
/**
* @package MDB
@@ -392,7 +392,13 @@
{
// The error is yet a MDB error object
if (is_object($code)) {
- $err = PEAR::raiseError($code, NULL, NULL, NULL, NULL, NULL, TRUE);
+ // because we the static PEAR::raiseError, our global
+ // handler should be used if it is set
+ if ($mode === null && !empty($this->_default_error_mode)) {
+ $mode = $this->_default_error_mode;
+ $options = $this->_default_error_options;
+ }
+ $err = PEAR::raiseError($code, NULL, $mode, $options, NULL, NULL, TRUE);
return($err);
}
@@ -401,7 +407,7 @@
}
if ($nativecode) {
- $userinfo .= " [nativecode = $nativecode]";
+ $userinfo .= ' [nativecode=' . trim($nativecode) . ']';
}
$err = PEAR::raiseError(NULL, $code, $mode, $options, $userinfo, 'MDB_Error',
TRUE);