Convert errors to \ErrorException instances
@param int $number
@param string $string
@param string $file
@param int $line
@throws \ErrorException
549386
public static function error($number, $string, $file, $line)
    {
        throw new \ErrorException($string, 0, $number, $file, $line);
    }
1299898
public function handleError($errNumber, $errString, $errFile ='', $errLine = 0)
	{
		$interfaceSettings = $this->cmd->getConfigOpt('interface');
		$textColor = $interfaceSettings['error']['text_color'];
		$textBgColor = $interfaceSettings['error']['text_background'];

		$this->env->sendOutput('Error: ' . $errString, $textColor, $textBgColor);
		exit;
	}
84204
protected function throwNumberFormatterException(IntlNumberFormatter $intlFormatter, $number): void
    {
        $error_code = $intlFormatter->getErrorCode();
        if (is_scalar($number)) {
            $val = (string) $number;
        } else {
            $val = 'type: ' . gettype($number);
        }
        throw new Exception\RuntimeException(__METHOD__ . " Cannot format value '$val', Intl/NumberFormatter error code: $error_code.");
    }
795422
public function handleFatalError($code, $message, $file, $line)
    {
        error_log($message, 0);
        $this->handleException(new FatalErrorException($message, 500, $file, $line));

        return true;
    }
634007
public function displayError($code, $message, $file, $line)
    {
        $data = array();
        $data['code'] = $code;
        $data['message'] = $message;
        $data['file'] = $file;
        $data['line'] = $line;
        $data['type'] = 'error';
        $data = $this->_formatError(debug_backtrace(), $data);
        $this->render('error', $data);

    }
627164
public function handleError($code, $description, $file = null, $line = null, $context = null) {
        // get error type
        $type = $this->mapErrorCode($code)[0] . ' Error: ';

        // send a debug mail with the error
        if(!$this->debug && !in_array($code, $this->_skipErrors))
            $this->_email('CLI Error', Misc::dump([
                'type' => rtrim($type, ': '),
                'description' => $description,
                'file' => $file,
                'line' => $line,
                'code' => $code,
                'context' => $context
            ], $type . $description, true));

        // continue with error handle logic
        return parent::handleError($code, $description, $file, $line, $context);
    }
138803
public static function errorToException($num, $mes, $file = null, $line = null, $context = null)
    {
        throw new Exception($mes, $num);
    }
703683
public function handleError(int $level, string $message, string $file, int $line)
    {
        if (error_reporting() && $level) {
            throw new \ErrorException($message, 0, $level, $file, $line);
        }
    }
1272476
public function addError($error, $key = null)
    {
        if (is_string($error)) {
            $error = new Exception($error);
        } elseif ($error instanceof Exception) {
            // Nothing to do
        } else {
            throw new Exception('only string errors or instances of Exception can be added');
        }

        if ($key) {
            $this->errors[$key] = $error;
        } else {
            $this->errors[] = $error;
        }

        return false;
    }
575407
public function writeError($line, $check, $message, $level = WARNING) {
		// echo $this->currentPhpFile . " " . $level . " Line:" . $line . " - " . $message . "\n";
		$this->outputFile[$this->currentPhpFile][$line][] = array(
			"level"   => $level,
			"line"    => $line,
			"message" => $message,
			"check"   => $check,
		);
	}
492238
public function handleError($code, $message, $file = '', $line = 0, $context = array())
    {
        if ($file == 'tmpl://com:base.template.stack' || $code == 1) {
            if ($file == 'tmpl://com:base.template.stack') {
                $file = $this->getPath();
            }

            if (ini_get('display_errors')) {
                echo '<strong>'.$code.'</strong>: '.$message.' in <strong>'.$file.'</strong> on line <strong>'.$line.'</strong>';
            }

            if (ini_get('log_errors')) {
                error_log(sprintf('PHP %s:  %s in %s on line %d', $code, $message, $file, $line));
            }

            return true;
        }

        return false;
    }
612972
public static function lastErrorMsg($file,$message,$data) {
		Console::writeLine(PHP_EOL."<error>The JSON file, ".$file.", wasn't loaded. The error: ".$message."</error>");
		if ($message == "Syntax error, malformed JSON") {
			Console::writeLine("");
			$parser = new JsonLint\JsonParser();
			$error  = $parser->lint($data);
			Console::writeError($error->getMessage(), false, true);
		}
	}
684519
public function raiseError( $number, $text = false)
    {
        $this->_errorNode->addAttribute("number", intval($number));
        if (false!=$text) {
            $this->_errorNode->addAttribute("text", $text);
        }

        echo $this->_connectorNode->asXML();
    }
684619
protected function _throw($file, $errorType)
    {
        if (null !== $file) {
            $this->_value = $file['name'];
        }

        $this->_error($errorType);
        return false;
    }
454183
public function appException($e)
    {
        throw new ErrorException($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine(), $e->getTrace());

    }
12684
public function php_error_handler($errno, $errstr, $errfile, $errline)
    {
        $e = new \Exception($errstr, $errno);
        call_user_func($this->error50x, $e);
    }
773150
public function errorHandler($type, $message, $file, $line)
    {
        $this->log(
        	'ErrorHandler: '
            . implode(' ', array($type, $message, $file, $line))
        );
    }