Just write an arbitary line to the filehandle

@param string $line  Content to write
@param string $error If error occurs, drop this message

@access protected
@return true|false
438768
protected function writeLine($line, $error = 'Net_LDAP2_LDIF error: unable to write to filehandle')
    {
        if (is_resource($this->handle()) && fwrite($this->handle(), $line, strlen($line)) === false) {
            $this->dropError($error);
            return false;
        } else {
            return true;
        }
    }
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;
        }
    }
1222189
public function writeError($line, $check, $message, $level = WARNING) {
		$errEl = $this->document->createElement("error");
		$errEl->setAttribute("line", $line);
		$errEl->setAttribute("column", "1");
		$errEl->setAttribute("severity", $level);
		$errEl->setAttribute("message", $message);
		$errEl->setAttribute("source", $check);

		if (empty($this->currentElement)) {
			$this->startNewElement("");
		}
		$this->currentElement->appendChild($errEl);
	}
103609
protected function put($line = '', $eol = PHP_EOL)
    {
        $this->m->shell->put($line, $eol);
    }
874622
protected function handleMessage($line)
    {
        if (!is_string($line)) {
            return false;
        }

        $parts = array_map('trim', explode(',', $line));
        if (count($parts) != 2) {
            return false;
        }

        $line = implode(" , ", $parts);
        if (!ctype_digit($parts[0]) || !ctype_digit($parts[1])) {
            return $line . " : ERROR : INVALID-PORT";
        }

        $cport = (int) $parts[0];
        $sport = (int) $parts[1];

        if ($sport <= 0 || $sport > 65535 || $cport <= 0 || $cport > 65535) {
            return $line . " : ERROR : INVALID-PORT";
        }

        foreach ($this->bot->getConnections() as $connection) {
            if ($connection == $this) {
                continue;
            }

            $socket = $connection->getSocket();

            $rport = (int) substr(strrchr(stream_socket_get_name($socket, true), ':'), 1);
            if ($rport != $sport) {
                continue;
            }

            $lport = (int) substr(strrchr(stream_socket_get_name($socket, false), ':'), 1);
            if ($lport != $cport) {
                continue;
            }

            try {
                $config     = $connection->getConfig(null);
                $identity   = $config->parseString(
                    '\\Erebot\\Module\\IrcConnector',
                    'identity',
                    ''
                );
                return $line . " : USERID : UNIX : " . $identity;
            } catch (\Erebot\Exception $e) {
                return $line . " : ERROR : HIDDEN-USER ";
            }
        }

        return $line . " : ERROR : NO-USER";
    }
747626
public function error($error) {
		return fwrite($this->error, Text::insert($error, $this->styles()));
	}
723934
public function errorHandler($code, $message, $file = '', $line = '')
    {
        if ($this->error_to_exception) {

            if (ob_get_length() > 0) {
                ob_end_clean(); // Fix templates
            }

            throw new Exception($message);
        }

        $error = array(
            'code' => $code,
            'file' => $file,
            'line' => $line,
            'message' => $message,
            'backtrace' => $this->log_backtrace ? gplcart_backtrace() : array()
        );

        $print = $this->print_error || !$this->isDb();

        if (in_array($code, $this->getFatalErrorTypes())) {

            if ($print) {
                return false; // Let it fall through to the standard PHP error handler
            }

            $this->log('php_shutdown', $error, 'danger', false);
            return true;
        }

        $key = md5(json_encode($error));

        if (isset($this->errors[$key])) {
            return true;
        }

        $this->errors[$key] = $error;

        if ($print) {
            echo $this->getFormattedError($error);
        }

        $this->log('php_error', $error, 'warning', false);
        return true;
    }
869427
protected function write($line)
    {
        for ($written = 0, $len = strlen($line); $written < $len; $written += $fwrite) {
            $fwrite = fwrite($this->socket, substr($line, $written));
            if ($fwrite === false) {
                throw new \Erebot\Exception('Connection closed by proxy');
            }
        }
        return $written;
    }
194863
public function writeError($line, $check, $message, $level = WARNING) {

		// Update the counters
		$this->nbErrors ++;
		$this->fileErrors ++;
		if ($this->fileInError === false) {
			$this->nbfilesError ++;
			$this->fileInError = true;
		}

		// Add the check to the details
		$detail = $this->_readTemplate("detail_body");
		$values = array();
		$values['%%message%%'] = htmlspecialchars($message);
		$values['%%check%%'] = $check;
		$values['%%line%%'] = $line;
		$values['%%level%%'] = $level;
		$detail = $this->_fillTemplate($detail, $values);
		$this->fileDetail .= $detail;
	}
1159253
private function processLine(string $line): void
    {
        $iterator = new \ArrayIterator(explode(Tokens::SPACE, $line));

        if ($this->isControlEntry($iterator)) {
            $this->processControlEntry($iterator);

            return;
        }

        $resourceRecord = new ResourceRecord();

        $this->processResourceName($iterator, $resourceRecord);
        $this->processTtl($iterator, $resourceRecord);
        $this->processClass($iterator, $resourceRecord);
        $resourceRecord->setRdata($this->extractRdata($iterator));

        $this->zone->addResourceRecord($resourceRecord);
    }
314050
public function error($errno, $error, $file, $line) {
        try {
            throw new MyException($error, $errno, $file, $line);
        } catch (MyException $e) {
            ERRORCODE($e);
        }
    }
401236
public function getFileLink($file, $line)
    {
        if ($fmt = $this->fileLinkFormat) {
            return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line);
        }

        return false;
    }
118244
public function handleError($level, $message, $file = '', $line = 0)
    {
        if (error_reporting() & $level) {
            $error = [
                'message' => $message,
                'file' => $file,
                'line' => $line,
                'type' => $level,
            ];

            switch ($level) {
                case E_USER_ERROR:
                    $this->record($error);
                    if ($this->container->runningInConsole()) {
                        $this->renderForConsole($error);
                    }

                    if (!$this->container->runningInConsole()) {
                        $this->renderHttpResponse($error);
                    }
                    break;
                default:
                    $this->record($error, 'warning');
                    break;
            }
            return true;
        }

        return false;
    }
1014140
protected function write($line, $level = 100)
    {
        $logfile = $this->getFilePath($level);
        $rotator = $this->getRotator($logfile);
        $return = $rotator->write($line);

        if ($this->isErrorLevel($level) && true===$this->duplicate_errors)
            self::write($line, 100);

        return $return;
    }
1201876
protected function processLine($line)
    {
        if ($line === '') {
            $this->handleBlankLine();
            return;
        }

        $this->justNewEntry = false;

        $data = $this->parseLine($line);

        if ($data['key'][0] === '#') {
            $this->handleComment($data);
            return;
        }

        $this->handleOtherCases($data, $line);
    }
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);
    }
1322443
public function handleException($exception, array $error = null)
    {
        if (null === $error) {
            self::$exitCode = 255;
        }
        if (!$exception instanceof \Exception) {
            $exception = new FatalThrowableError($exception);
        }
        $type = $exception instanceof FatalErrorException ? $exception->getSeverity() : E_ERROR;
        $handlerException = null;

        if (($this->loggedErrors & $type) || $exception instanceof FatalThrowableError) {
            if (false !== strpos($message = $exception->getMessage(), "class@anonymous\0")) {
                $message = (new FlattenException())->setMessage($message)->getMessage();
            }
            if ($exception instanceof FatalErrorException) {
                if ($exception instanceof FatalThrowableError) {
                    $error = [
                        'type' => $type,
                        'message' => $message,
                        'file' => $exception->getFile(),
                        'line' => $exception->getLine(),
                    ];
                } else {
                    $message = 'Fatal '.$message;
                }
            } elseif ($exception instanceof \ErrorException) {
                $message = 'Uncaught '.$message;
            } else {
                $message = 'Uncaught Exception: '.$message;
            }
        }
        if ($this->loggedErrors & $type) {
            try {
                $this->loggers[$type][0]->log($this->loggers[$type][1], $message, ['exception' => $exception]);
            } catch (\Throwable $handlerException) {
            }
        }
        if ($exception instanceof FatalErrorException && !$exception instanceof OutOfMemoryException && $error) {
            foreach ($this->getFatalErrorHandlers() as $handler) {
                if ($e = $handler->handleError($error, $exception)) {
                    $exception = $e;
                    break;
                }
            }
        }
        $exceptionHandler = $this->exceptionHandler;
        $this->exceptionHandler = null;
        try {
            if (null !== $exceptionHandler) {
                return $exceptionHandler($exception);
            }
            $handlerException = $handlerException ?: $exception;
        } catch (\Throwable $handlerException) {
        }
        if ($exception === $handlerException) {
            self::$reservedMemory = null; // Disable the fatal error handler
            throw $exception; // Give back $exception to the native handler
        }
        $this->handleException($handlerException);
    }