Produces a nicely formatted error message by supplying the
stack frame information OUTSIDE of HTMLPurifier_Config.

@param string $msg An error message
@param int $no An error number
193713
protected function triggerError($msg, $no)
    {
        // determine previous stack frame
        $extra = '';
        if ($this->chatty) {
            $trace = debug_backtrace();
            // zip(tail(trace), trace) -- but PHP is not Haskell har har
            for ($i = 0, $c = count($trace); $i < $c - 1; $i++) {
                // XXX this is not correct on some versions of HTML Purifier
                if ($trace[$i + 1]['class'] === 'HTMLPurifier_Config') {
                    continue;
                }
                $frame = $trace[$i];
                $extra = " invoked on line {$frame['line']} in file {$frame['file']}";
                break;
            }
        }
        trigger_error($msg . $extra, $no);
    }
942985
protected function showError($msg = null)
    {
        if ($msg === null) {
            $msg = 'Sitemap is not available, please check your configuration';
        }

        header('HTTP/1.0 503 Service Unavailable');
        $GLOBALS['TSFE']->pageErrorHandler(true, null, $msg);
        exit;
    }
721079
private function processError(Session $session, ErrorMessage $msg)
    {
        switch ($msg->getErrorMsgCode()) {
            case Message::MSG_INVOCATION:
                $this->processInvocationError($session, $msg);
                break;
            case Message::MSG_INTERRUPT:
                $this->processInterruptError($session, $msg);
                break;
        }
    }
486969
public void error(final String msg) {
        if (proxy.isErrorEnabled()) {
            if (proxy instanceof LocationAwareLogger) {
                ((LocationAwareLogger) proxy).log(null, FQCN, LocationAwareLogger.ERROR_INT, msg, null, null);
            } else {
                proxy.error(msg);
            }
        }
    }
295286
public function error($msg, $data = NULL) {
        if (!$this->isAllowToLog(static::LOG_LEVEL_ERROR)) {
            return;
        }

        $this->log('error', $msg, $data);
    }
763725
protected function dropError($msg, $line = null)
    {
        $this->_error['error'] = new Net_LDAP2_Error($msg);
        if ($line !== null) $this->_error['line'] = $line;

        if ($this->_options['onerror'] == 'die') {
            die($msg.PHP_EOL);
        } elseif ($this->_options['onerror'] == 'warn') {
            echo $msg.PHP_EOL;
        }
    }
290594
public function oneOf(array $choices, $msg)
    {
        if(!in_array($this->_value, $choices)) {
            $this->_errors[] = $msg;
        }
        return $this;
    }
79718
private function _addError($attr, $msg)
    {
        if (!array_key_exists($attr, $this->errors)) {
            $this->errors[$attr] = array();
        }
        array_push($this->errors[$attr], $msg);
    }
472442
public function set_error_message($rule, $msg)
	{
		empty($rule) and $rule = 0;
		$this->error_messages[$rule] = strval($msg);

		return $this;
	}
1143656
public function throwParseError($msg = 'parse error')
    {
        list($line, /* $column */) = $this->getSourcePosition($this->count);

        $loc = empty($this->sourceName) ? "line: $line" : "$this->sourceName on line $line";

        if ($this->peek("(.*?)(\n|$)", $m, $this->count)) {
            throw new ParserException("$msg: failed at `$m[1]` $loc");
        }

        throw new ParserException("$msg: $loc");
    }
1186445
static function line($message = '', $newLine = 'after') {
		if($newLine == 'before' || $newLine == 'both') {
			echo PHP_EOL;
		}
		echo self::formatMessage("Error. $message", ['fg-red']);
		if($newLine == 'after' || $newLine == 'both') {
			echo PHP_EOL;
		}
	}
607257
static public function
	Message($msg='',$opt=null) {
	/*//
	@argv string Message, object Options

	print a string to the terminal, automatically doing line wrapping. if the
	string has a prefix of white space, then that prefix will be appended
	to all the lines after line wrapping, all without breaking the specified
	width of the wrap.

	if prefix is Boolean True, then we will scoop off the prefix of whitespace
	from the beginning of the string and use it on each line that was wrapped.
	if was a string to start with, then we will just use that prefix.
	//*/

		$opt = new Nether\Object\Mapped($opt,[
			'EOL'    => PHP_EOL,
			'Prefix' => true,
			'Width'  => 75
		]);

		////////
		////////

		// scoop a prefix off the start of the string.
		if($opt->Prefix === true)
		$opt->Prefix = preg_replace('/^([\s]*).*?$/','\1',$msg);

		////////
		////////
		if($opt->Width) {
			// consider the prefix length.
			$opt->Width -= strlen($opt->Prefix);

			// wrap the text.
			$msg = wordwrap($msg,$opt->Width,$opt->EOL);
		}

		// apply the prefix.
		$lines = explode($opt->EOL,$msg);
		foreach($lines as $k => $v) $lines[$k] = sprintf(
			'%s%s',
			$opt->Prefix,
			ltrim($v)
		);

		echo implode($opt->EOL,$lines), $opt->EOL;
		return;
	}
84913
protected function getErrorResponse($msg, $errorCode, $statusText, $headers = [])
    {
        return $this->setStatusText($this->statusTexts[$statusText])
                    ->setStatusCode($statusText)
                    ->setStatusMessage(self::ERROR_TEXT)
                    ->setErrorCode($errorCode)
                    ->setErrorMessage($msg)
                    ->respondWithErrorMessage($headers);
    }
572280
public static function clearMsg($msg)
    {
        $nmsg = str_replace([' standalone="no"', 'default:', ':default', "\n", "\r", "\t"], '', $msg);
        $nnmsg = str_replace('> ', '>', $nmsg);
        if (strpos($nnmsg, '> ')) {
            $nnmsg = self::clearMsg((string) $nnmsg);
        }

        return $nnmsg;
    }
558961
protected function logError(string $msg)
    {
        $this->logger->error('CMD: ' . $msg);
        $this->out->writeln("<error>$msg<error>");
    }
1195376
protected function parseError($msg) {
        $args = func_get_args();

        if (count($args) > 1) {
            array_shift($args);
            $msg = vsprintf($msg, $args);
        }

        $line = $this->scanner->currentLine();
        $col = $this->scanner->columnOffset();
        $this->events->parseError($msg, $line, $col);
        return false;
    }
160849
@Override
    public void error( F0<String> msg )
    {
        if ( compilerLogger.isErrorEnabled() )
        {
            String msgString = msg.apply();
            errors.append( msgString ).append( '\n' );
            compilerLogger.error( msgString );
        }
    }