Don't spew a notice warning to output while processing logging for PEAR DB errors

This commit is contained in:
Brion Vibber 2010-09-20 16:52:22 -07:00
parent a47e664094
commit aef42e2f65

View File

@ -1480,7 +1480,12 @@ function common_log_db_error(&$object, $verb, $filename=null)
{ {
$objstr = common_log_objstring($object); $objstr = common_log_objstring($object);
$last_error = &PEAR::getStaticProperty('DB_DataObject','lastError'); $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError');
common_log(LOG_ERR, $last_error->message . '(' . $verb . ' on ' . $objstr . ')', $filename); if (is_object($last_error)) {
$msg = $last_error->message;
} else {
$msg = 'Unknown error (' . var_export($last_error, true) . ')';
}
common_log(LOG_ERR, $msg . '(' . $verb . ' on ' . $objstr . ')', $filename);
} }
function common_log_objstring(&$object) function common_log_objstring(&$object)