From: Evan Prodromou Date: Thu, 8 Mar 2012 12:57:54 +0000 (-0600) Subject: Merge from 1.0.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=eb6b4628b95f1bb770b01df86eacab756f28364b;p=quix0rs-gnu-social.git Merge from 1.0.x --- eb6b4628b95f1bb770b01df86eacab756f28364b diff --cc lib/framework.php index 05a8b7abda,e7a1829bc6..8f5cdf31c6 --- a/lib/framework.php +++ b/lib/framework.php @@@ -151,10 -152,28 +151,27 @@@ function PEAR_ErrorToPEAR_Exception($er if ($err->getCode() == DB_DATAOBJECT_ERROR_NODATA) { return; } + + $msg = $err->getMessage(); + $userInfo = $err->getUserInfo(); + + // Log this; push the message up as an exception + + common_log(LOG_ERR, "PEAR Error: $msg ($userInfo)"); + + // HACK: queue handlers get kicked by the long-query killer, and + // keep the same broken connection. We die here to get a new + // process started. + + if (php_sapi_name() == 'cli' && preg_match('/nativecode=2006/', $userInfo)) { + common_log(LOG_ERR, "Lost DB connection; dying."); + exit(100); + } + if ($err->getCode()) { - throw new PEAR_Exception($msg, $err, $err->getCode()); - } else { - throw new PEAR_Exception($msg, $err); + throw new PEAR_Exception($err->getMessage(), $err->getCode()); } + throw new PEAR_Exception($err->getMessage()); } PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'PEAR_ErrorToPEAR_Exception');