Set iumio framework custom handler
@param string $err_no Error type value
@param string $err_msg Error message
@param string $errfile Error file
@param string $errline Error line
@throws
969327
final public static function errorHandler(string $err_no, string $err_msg, string $errfile, string $errline)
    {
        throw new Server500(new \ArrayObject(array("explain" => $err_msg,
            "type_error" => self::errorMap($err_no), "line_error" => $errline, "file_error" => $errfile)));
    }
905946
public static function ExceptionErrorHandler($errno = 0, $errstr = null, $errfile = null, $errline = null)
    {
        // If error is suppressed with @, don't throw an exception
        if (error_reporting() === 0 || strpos($errstr, 'headers already sent') || ($errfile && strpos($errfile, 'vendor/amphp') !== false)) {
            return false;
        }

        throw new self($errstr, $errno, null, $errfile, $errline);
    }
318348
public function _handleError($errno, $errstr, $errfile, $errline, $context=null)
	{
		// process errors based on the error reporting settings
		if (error_reporting() & $errno)
		{
			try
			{
				// bit of a hack to consolidate errors to exceptions
				$message = $this->_errorNumberString($errno).': '.$errstr;
				throw new \ErrorException($message,0,$errno,$errfile,$errline);
			}
			catch(\ErrorException $e)
			{
				$this->_handleException($e);
			}
		}
	}
90001
private function logError($errno, $errstr, $errfile, $errline)
    {
        if (!($errno & $this->loggedErrors)) {
            return false;
        }

        $loggedLevel = isset($this->logLevels[$errno]) ? $this->logLevels[$errno] : 'error';

        $stacktrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
        $stacktrace = array_slice($stacktrace, 2);

        array_unshift($stacktrace, [
            'file' => $errfile,
            'line' => $errline,
        ]);

        $this->logger->log($loggedLevel, $errstr, [
            'errorCode' => $errno,
            'errorType' => self::getErrorType($errno),
            'errorFile' => $errfile,
            'errorLine' => $errline,
            'errorStacktrace' => $this->formatStacktrace($stacktrace),
        ]);

        return true;
    }
65374
public function handleError($errno, $errstr, $errfile, $errline)
    {
        if (!$this['debug']) {
            return;
        }

        throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
    }
1069976
public function PHPErrorHandler($error_level, $error_message, $error_file, $error_line, $error_context)
    {
        $message = $error_message . ' | File: {file} | Ln: {line}';
        $context = array(
            'file' => $error_file,
            'line' => $error_line
        );

        switch ($error_level) {
            case E_USER_ERROR:
                // no break
            case E_RECOVERABLE_ERROR:
                $this->logger->error($message, $context);
                break;
            case E_WARNING:
                // no break
            case E_USER_WARNING:
                $this->logger->warning($message, $context);
                break;
            case E_NOTICE:
                // no break
            case E_USER_NOTICE:
                $this->logger->notice($message, $context);
                break;
            case E_STRICT:
                $this->logger->debug($message, $context);
                break;
            default:
                $this->logger->warning($message, $context);
        }
        return;
    }
45608
static public function handleSilentWriteClose($errno, $errstr, $errfile, $errline, $errcontext)
    {
        self::$sessionStartError .= PHP_EOL . $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr;
    }
661968
private function catchWarning($errno, $errstr, $errfile, $errline)
    {
        $this->setError(array(
            'error' => "Connecting to the POP3 server raised a PHP warning: ",
            'errno' => $errno,
            'errstr' => $errstr,
            'errfile' => $errfile,
            'errline' => $errline
        ));
    }
1033660
static function errorHandler($errno, $errstr, $errfile, $errline) {
	    switch ($errno) {
	    case E_USER_ERROR:
	        echo "<b>ERROR:</b> [$errno] $errstr<br>
	        <b>File: </b>$errfile [$errline]<br>
	        Aborting...<br>";
	        exit(1);
	        break;

	    case E_USER_WARNING:
	        echo "<b>WARNING:</b> [$errno] $errstr<br><b>File:</b> $errfile [$errline]";
	        break;

	    case E_USER_NOTICE:
	        echo "<b>NOTICE:</b> [$errno] $errstr<br><b>File:</b> $errfile [$errline]";
	        break;

	    default:
	        echo "<b>Unknown error type:</b> [$errno] $errstr<br><b>File:</b> $errfile [$errline]";
	        break;
	    }

	    /* Don't execute PHP internal error handler */
	    return true;
	}
1144963
public function setErrorHandle($err, $message, $file, $line) {
        $oJsonRpc = JsonRpc::getInstance();
        $content = explode("\n", file_get_contents($file));
        header('Content-Type: application/json');
        $id = $oJsonRpc->extractId();
        $error = array(
           "code" => 100,
           "message" => "Server error",
           "error" => array(
              "name" => "PHPErorr",
              "code" => $err,
              "message" => $message,
              "file" => $file,
              "at" => $line,
              "line" => $content[$line-1]));
        ob_end_clean();
        echo $oJsonRpc->response(null, $id, $error);
        exit();
    }
1294176
protected function buildErrorTrace($errfile, $errline)
    {
        if ($this->captureErrorStacktraces) {
            $backTrace = $this->fetchErrorTrace();
            
            $backTrace = $this->stripShutdownFrames($backTrace);
            
            // Add the final frame
            array_unshift(
                $backTrace,
                array('file' => $errfile, 'line' => $errline)
            );
        } else {
            $backTrace = array();
        }
        
        return $backTrace;
    }
111835
public static function errorHandler($iError, $sMsg, $sFile, $sLine) {
		if (Tango::isStopError($iError)) {
			self::handler(new TangoException($sMsg, 2), FALSE);
		}
		return FALSE;
	}
580376
public static function errorHandler($errno, $errstr, $errfile, $errline)
    {
        throw new KernelException($errno . ': ' . $errstr . '[' . $errfile . ' (' . $errline . ')]');
    }
1003664
public static function appError($errno, $errstr, $errfile = '', $errline = 0)
    {
        if (error_reporting() & $errno) {
            // 委托给异常处理
            if (self::isFatalWarning($errno, $errstr)) {
                self::appException(new \Mix\Exception\ErrorException($errno, $errstr, $errfile, $errline));
                return;
            }
            // 转换为异常抛出
            throw new \Mix\Exception\ErrorException($errno, $errstr, $errfile, $errline);
        }
    }
31358
public static function errorHandler($errno, $errstr, $errfile, $errline, $errcontext)
    {
        Daemon::$noError = false;
        $l = error_reporting();
        if ($l === 0) {
            if (!Daemon::$restrictErrorControl) {
                return;
            }
        } elseif (!($l & $errno)) {
            return;
        }

        static $errtypes = [
            E_ERROR => 'Fatal error',
            E_WARNING => 'Warning',
            E_PARSE => 'Parse error',
            E_NOTICE => 'Notice',
            E_PARSE => 'Parse error',
            E_USER_ERROR => 'Fatal error (userland)',
            E_USER_WARNING => 'Warning (userland)',
            E_USER_NOTICE => 'Notice (userland)',
            E_STRICT => 'Notice (userland)',
            E_RECOVERABLE_ERROR => 'Fatal error (recoverable)',
            E_DEPRECATED => 'Deprecated',
            E_USER_DEPRECATED => 'Deprecated (userland)',
        ];
        $errtype = $errtypes[$errno];
        Daemon::log($errtype . ': ' . $errstr . ' in ' . $errfile . ':' . $errline . "\n" . Debug::backtrace());
        if (Daemon::$context instanceof \PHPDaemon\Request\Generic) {
            Daemon::$context->out('<strong>' . $errtype . '</strong>: ' . $errstr . ' in ' . basename($errfile) . ':' . $errline . '<br />');
        }
    }
552364
protected function _errorhandler_file($errstr, $backtrace, $errortype) {
		$body  = '############################## '.$errortype."\n";
		$body .= 'Datum:      '.date("d.m.Y - H:i:s")."\n";
		
		if (isset($_SERVER['REQUEST_URI'])) {
			$body .= 'URL:        '.$_SERVER['REQUEST_URI']."\n";
			$body .= 'IP:         '.$_SERVER['REMOTE_ADDR']."\n";
			$body .= 'User-Agent: '.(isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '-') ."\n";
		} else {
			$body .= 'CLI:        '.(implode(' ', $_SERVER['argv']))."\n";
		}

		$body .= 'Meldung:    '.$errstr."\n";
		$body .= 'Backtrace:  '."\n\n";

		foreach ($backtrace as $value) {
			$body .= '       File: '.$value['file']." (Line ".$value['line'].")\n";
			$body .= '   Function: '.$value['class'].$value['type'].$value['function'].'()'."\n\n";
		}
		$body .= "\n";

		file_put_contents($this->_logfile, $body, FILE_APPEND);
	}
979176
private function handleMustacheErrors($errno, $errstr, $errfile, $errline)
    {
        if (!empty($this->lastTemplate)) {
            if (function_exists('newrelic_add_custom_parameter')) {
                call_user_func(
                    'newrelic_add_custom_parameter',
                    'contactclientToken',
                    $this->lastTemplate
                );
            }
        }
        if (!empty($this->context)) {
            if (function_exists('newrelic_add_custom_parameter')) {
                call_user_func(
                    'newrelic_add_custom_parameter',
                    'contactclientContext',
                    json_encode($this->context)
                );
            }
        }
        $this->logger->error(
            'Contact Client '.$this->contactClient->getId().
            ': Warning issued with Template: '.$this->lastTemplate.' Context: '.json_encode($this->context)
        );

        return true;
    }