We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit d07780b4 authored by Evan Prodromou's avatar Evan Prodromou

Output native PEAR DB errors to the log file

parent 9c2e4549
......@@ -151,10 +151,19 @@ function PEAR_ErrorToPEAR_Exception($err)
if ($err->getCode() == DB_DATAOBJECT_ERROR_NODATA) {
$msg = $err->getMessage();
$userInfo = $err->getUserInfo();
// Log this; push the message up as an exception
common_log(LOG_ERR, "PEAR Error: $msg ($userInfo)");
if ($err->getCode()) {
throw new PEAR_Exception($err->getMessage(), $err->getCode());
throw new PEAR_Exception($msg, $err, $err->getCode());
} else {
throw new PEAR_Exception($msg, $err);
throw new PEAR_Exception($err->getMessage());
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'PEAR_ErrorToPEAR_Exception');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment