/** * Handle an error condition that happened somewhere in our main request processing code. If the * error cannot be handled, then add an error in the event log. * @param GalleryStatus a status code * @param array $g2Data the results from _GalleryMain */ function _GalleryMain_errorHandler($error, $g2Data = null) { global $gallery; GalleryCoreApi::requireOnce('modules/core/ErrorPage.inc'); $handledError = ErrorPageView::errorHandler($error, $g2Data); if (!$handledError) { $summary = $error->getErrorMessage(); if (empty($summary)) { $summary = join(', ', $error->getErrorCodeConstants($error->getErrorCode())); } GalleryCoreApi::addEventLogEntry('Gallery Error', $summary, $error->getAsText()); } }