Invoke default Error Handler.

@param int $code
@param string $message
@param string $file
@param int $line
@throws FatalError
@throws NoticeError
@throws WarningError
559646
public static function handleError($code, $message, $file, $line)
    {
        $list = static::getSystemError($code);
        $name = $list[0];
        $type = $list[1];

        $message = "\"$message\" in $file:$line";

        switch ($type)
        {
            case static::E_NOTICE:  throw new NoticeError($message);
            case static::E_WARNING: throw new WarningError($message);
            case static::E_ERROR:   throw new FatalError($message);
            default:                return;
        }
    }
358781
public function error($code, $msg, $file, $line)
    {
        $type = $this->getErrorType($code);

        $this->setParams($type, $code, $msg, $file, $line, '', 0);

        return $this->render();
    }
1244816
public static function errorHandler($level, $message, $file, $line)
    {
        if (! ($level & error_reporting()))
            return false;
        switch ($level) {
            case E_NOTICE:
            case E_USER_NOTICE:
                $method = 'notice';
                $type = 'Notice';
                break;
            case E_WARNING:
            case E_USER_WARNING:
                $method = 'warn';
                $type = 'Warning';
                break;
            case E_ERROR:
            case E_USER_ERROR:
                $method = 'crit';
                $type = 'Fatal Error';
                break;
            default:
                $method = 'err';
                $type = 'Unknown, ' . $level;
                break;
        }
        self::$errors[] = array(
            'type' => $type ,
            'message' => $message ,
            'file' => $file ,
            'line' => $line,
            'trace' => debug_backtrace()
        );

        $message = sprintf(
            "%s in %s on line %d",
            $message,
            str_replace($_SERVER['DOCUMENT_ROOT'], '', $file),
            $line
        );
        // if (ini_get('log_errors'))
        //     error_log(sprintf("%s: %s", $type, $message));

        if (($logger = self::getLogger())) {
            $logger->$method($message);
        }
        return false;
    }
92429
protected function handleError($code, $msg) {
    if (isset($this->options['error_handler'])) {
      $handler = $this->options['error_handler'];
      $handler($code, $msg);
    }

    if ($this->debug()) {
      error_log("[Analytics][" . $this->type . "] " . $msg);
    }
  }
862758
public function writeError($line, $check, $message, $level = WARNING) {
		$msg = "\t" . $level . " Line:" . $line . ": " . $message . PHP_EOL;
		$this->_write($msg);
	}
197381
protected function throwError(/*# string */ $message, /*# int */ $code)
    {
        switch ($this->error_type) {
            case self::ERROR_WARNING:
                trigger_error($message, \E_USER_WARNING);
                break;
            case self::ERROR_EXCEPTION:
                throw new LogicException($message, $code);
            default:
                break;
        }
        return $this;
    }
182244
public function error($code, $message, $file, $line)
    {
        if ($code && error_reporting()) {
            if (X_DEBUG && PHP_SAPI !='cli') {
                $error = self::getComponent('errorHandler');
                $error->displayError($code, $message, $file, $line);
            } else if(PHP_SAPI =='cli'){
                echo $message;
            }else {
                $errorCallBack = \X\Router::$error_callback;
                if ($errorCallBack) {
                    call_user_func($errorCallBack, ['message' => $message, 'file' => $file, 'line' => $line]);
                    exit;
                } else {
                    echo '<fieldset style="background: #F3F3F3">';
                    echo '<legend style="color:red;">error[' . $code . ']</legend>';
                    echo '<p>' . $message . '  (' . $file . '[' . $line . '])</p>';
                    echo '</fieldset>';

                    echo '<fieldset style="background: #ddd;">';
                    echo '<legend style="color:#800000">trace</legend>';
                    echo '<pre>';
                    debug_print_backtrace();
                    echo '</pre>';
                    echo '</fieldset>';
                }
            }
        }
    }
773150
public function errorHandler($type, $message, $file, $line)
    {
        $this->log(
        	'ErrorHandler: '
            . implode(' ', array($type, $message, $file, $line))
        );
    }
924315
public function handleError($number, $message, $file, $line, array $context)
    {
        // This avoids silenced (@'ed) errors from being reported.
        if (error_reporting()) {
            $message = "PHP error $number: $message\n\tat $file:$line";
            Logger::get()->error($message);
            $this->handleException(new \RuntimeException($message));
        }
    }
1155434
final public static function errorHandler($severity, $message, $filepath, $line)
	{
		$is_error = (((E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR) & $severity) === $severity);

		$level = self::$levels[$severity];

		$context = self::getContext(self::ERROR, $level, $message, $filepath, $line);

		if (!in_array($severity, array_merge([E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR], self::$ignore), true)) {

			error_log("{$level}: {$message} in {$filepath} in line {$line}");

			if (!empty(self::$logger)) {
				self::$logger->error("{$level}: {$message} in {$filepath} in line {$line}", $context);
			}
		}

		if ($is_error) {
			if (!empty(self::$logger)) {
				self::$logger->critical("{$level}: {$message} in {$filepath} in line {$line}", $context);
			}

			if (!is_null(self::$lastAction)) {
				$fn = self::$lastAction;
				$fn();
			}

			self::$httpHandler->overwrite(self::getErrorTemplate(self::$httpHandler, self::$defaultErrorPath))->withStatus(500)->send();
		}
	}
214340
private function _error($message, $level = E_USER_NOTICE)
	{
		$caller = next(debug_backtrace());

		switch ($level)
		{
			case E_USER_NOTICE:
				echo "Notice: ";
				break;
			case E_USER_ERROR:
				echo "Fatal error: ";
				break;
			default:
				echo "Unknown error: ";
				break;
		}

		echo $message . ' in ' . $caller['file'] . ' on line ' . $caller['line'] . "\n";
	}
940606
public function handleError(int $severity, string $message, 
        string $filename = null, int $lineno = 0, array $context = []
    ) : void
    {
        throw new \ErrorException($message, 0, $severity, $filename, $lineno);
    }
1238370
public function handleError($type, $message, $file, $line, $context)
    {
        if ($this->errorReporting() & $type) {
            $error = new \ErrorException($message, 0, $type, $file, $line);

            if ($this->convertFatalErrors && ($type & (E_RECOVERABLE_ERROR | E_USER_ERROR))) {
                throw $error;
            }

            if ($this->getLoggedErrorTypes() & $type) {
                $this->log($error);
            }
        }
        
        return $this->chainedErrorHandler
            ? call_user_func($this->chainedErrorHandler, $type, $message, $file, $line, $context)
            : false;
    }
670503
public function callErrorTrait($message, int $code, ?Exception $previous, $thrower): void
    {
        $message = $this->createMessage($message, $code);
        /** @noinspection PhpUndefinedMethodInspection */
        /** @noinspection PhpUndefinedClassInspection */
        parent::__construct($message, $code, $previous);
        $this->truncateTrace($thrower);
    }
786007
public static function errorHandlerCallback($code, $string, $file, $line, $context)
    {
        $e = new self($string, $code);
        $e->line = $line;
        $e->file = $file;
        throw $e;
    }
1165163
public static function native($code, $error, $file, $line, Logger $logger, $reporting, $exit = true)
    {
        if ($reporting === 0) {
            return;
        }

        // create an ErrorException for the PHP error
        $exception = new \ErrorException($error, $code, 0, $file, $line);

        if (in_array($code, (array)Config::get('error.ignore_levels'))) {
            return static::log($exception, $logger);
        }

        // display the ErrorException
        static::exception($exception, $logger, $exit);
    }
278041
public function handleError($error, $code, $path, $source, $parameters, $options)
    {
        /* @var \Throwable $error */
        $exception = $options['debug']
            ? $this->getDebuggedException($error, $code, $source, $path, $parameters, $options)
            : $error;

        $handler = $options['error_handler'];
        if (!$handler) {
            // @codeCoverageIgnoreStart
            if ($options['debug'] && $options['exit_on_error']) {
                if ($options['html_error']) {
                    echo $exception->getMessage();
                    exit(1);
                }
                if (!function_exists('xdebug_is_enabled') || !xdebug_is_enabled()) {
                    echo $exception->getMessage()."\n".$exception->getTraceAsString();
                    exit(1);
                }
            }
            // @codeCoverageIgnoreEnd
            throw $exception;
        }

        $handler($exception);
    }