예제 #1
0
파일: main.php 프로젝트: justinlyon/scc
/**
 * 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());
    }
}