function Concrete5_Exception_Handler($e) { // log if setup to do so if (ENABLE_LOG_ERRORS) { $db = Loader::db(); $tables = $db->MetaTables(); if (in_array('Logs', $tables)) { $l = new Log(LOG_TYPE_EXCEPTIONS, true, true); $l->write(t('Exception Occurred: ') . sprintf("%s:%d %s (%d)\n", $e->getFile(), $e->getLine(), $e->getMessage(), $e->getCode())); $l->write($e->getTraceAsString()); $l->close(); } } if (Config::get('SITE_DEBUG_LEVEL') == DEBUG_DISPLAY_ERRORS) { View::renderError(t('An unexpected error occurred.'), $e->getMessage(), $e); } else { View::renderError(t('An unexpected error occurred.'), t('An error occurred while processing this request.'), $e); } }
/** * @private */ public static function defaultExceptionHandler($e) { if (Config::get('SITE_DEBUG_LEVEL') == DEBUG_DISPLAY_ERRORS) { View::renderError(t('An unexpected error occurred.'), $e->getMessage(), $e); } else { View::renderError(t('An unexpected error occurred.'), t('An error occurred while processing this request.'), $e); } // log if setup to do so if (ENABLE_LOG_ERRORS) { $l = new Log(LOG_TYPE_EXCEPTIONS, true, true); $l->write(t('Exception Occurred: ') . $e->getMessage()); $l->write($e->getTraceAsString()); $l->close(); } }
/** * @private */ public static function defaultExceptionHandler($e) { View::renderError(t('An unexpected error occurred.'), $e->getMessage(), $e); }