Exemple #1
0
/**
 * Default error handler
 *
 * @param string $errno
 * @param string $errstr
 * @param string $errfile
 * @param string $errline
 * @return string error output
 */
function error_default_handler($errno, $errstr, $errfile, $errline)
{
    $is_http_err = http_response_status_is_valid($errno);
    $http_error_code = $is_http_err ? $errno : SERVER_ERROR;
    status($http_error_code);
    return $http_error_code == NOT_FOUND ? error_not_found_output($errno, $errstr, $errfile, $errline) : error_server_error_output($errno, $errstr, $errfile, $errline);
}
Exemple #2
0
/**
 * Default error handler
 *
 * @param string $errno 
 * @param string $errstr 
 * @param string $errfile 
 * @param string $errline 
 * @return string error output
 */
function error_default_handler($errno, $errstr, $errfile, $errline)
{
    $is_http_err = http_response_status_is_valid($errno);
    $http_error_code = $is_http_err ? $errno : SERVER_ERROR;
    status($http_error_code);
    if (($errno == E_USER_NOTICE || $errno == E_NOTICE) && option('debug')) {
        $o = "<p>[" . error_type($errno) . "] ";
        $o .= "{$errstr} in <strong>{$errfile}</strong> line <strong>{$errline}</strong>: ";
        $o .= "</p>";
        error_notice($o);
        return;
    }
    return $http_error_code == NOT_FOUND ? error_not_found_output($errno, $errstr, $errfile, $errline) : error_server_error_output($errno, $errstr, $errfile, $errline);
}