Format how an error or warning should be displayed.
541287
def format_failure(failure):
    """"""
    return "Line {}, Column {} - #{}: {} - Category: {}, Severity: {}".format(
        failure.getLine(),
        failure.getColumn(),
        failure.getErrorId(),
        failure.getMessage(),
        failure.getCategoryAsString(),
        failure.getSeverity()
    )
363225
def warning(self, *args) -> "Err":
        
        error = self._create_err("warning", *args)
        print(self._errmsg(error))
        return error
20281
private function displayError() {

		if(count($this -> options['ip']) === 0 || true === in_array(Request :: getIp(), $this -> options['ip'])) {

			$error = [

				'type'		=> $this -> error -> getType(),
				'text' 		=> $this -> error -> getMessage(),
				'file'		=> $this -> error -> getFile(),
				'line'		=> $this -> error -> getLine(),
				'backtrace' => $this -> formatBacktrace()
			];

			exit('<pre>' . print_r($error, true) . '</pre>');
		}
	}
831966
def json_error_formatter(body, status, title, environ):
    """"""
    body = webob.exc.strip_tags(body)
    status_code = int(status.split(None, 1)[0])
    error_dict = {
        'status': status_code,
        'title': title,
        'detail': body
    }
    return {'errors': [error_dict]}
689512
def error(message, *args, **kwargs):
    

    print('[!] ' + message.format(*args, **kwargs))
    sys.exit(1)
1274884
function formatErrors(errors, formatters, errorType) {
  const format = (formatter) => formatter(errors, errorType) || [];
  const flatten = (accum, curr) => accum.concat(curr);

  return formatters.map(format).reduce(flatten, [])
}
550911
function formatError(e) {
    if (!e.err) {
        return e.message
    }
    // PluginError
    if (typeof e.err.showStack === 'boolean') {
        return e.err.toString()
    }
    // Normal error
    if (e.err.stack) {
        return e.err.stack
    }
    // Unknown (string, number, etc.)
    return new Error(String(e.err)).stack
}
1083317
def error(self, msg, indent=0, **kwargs):
        """"""
        return self.logger.error(self._indent(msg, indent), **kwargs)
763129
def line_error(self, text, style=None, verbosity=None):
        
        if style:
            styled = "<%s>%s</>" % (style, text)
        else:
            styled = text

        self._io.error_line(styled, verbosity)
255629
function formatError(error, stack) {
  if (origPrepareStackTrace) {
    return origPrepareStackTrace(error, stack);
  }
  return [
    error.toString(),
    stack
      .map(function (frame) {
        return 'at ' + frame.toString();
      })
      .map(padLeft)
      .join('\n')
  ].join('\n');
}
697831
def _emit_error(cls, message):
        """"""
        sys.stderr.write('ERROR: {message}\n'.format(message=message))
        sys.stderr.flush()
1085995
def format_errors(errors):
        

        def _get_message(node):
            """
            Get the message to display in the error output.
            """
            messages = set()

            try:
                messages.update([node['message']])
            except KeyError:
                pass

            for check_group in ['any', 'all', 'none']:
                try:
                    for check in node[check_group]:
                        messages.update([check.get('message')])
                except KeyError:
                    pass

            messages = messages.difference([''])
            return '; '.join(messages)

        lines = []
        for error_type in errors:
            lines.append(u"Severity: {}".format(error_type.get("impact")))
            lines.append(u"Rule ID: {}".format(error_type.get("id")))
            lines.append(u"Help URL: {}\n".format(error_type.get('helpUrl')))

            for node in error_type['nodes']:
                msg = u"Message: {}".format(_get_message(node))
                html = u"Html: {}".format(node.get('html').encode('utf-8'))
                target = u"Target: {}".format(node.get('target'))
                fill_opts = {
                    'width': 100,
                    'initial_indent': '\t',
                    'subsequent_indent': '\t\t',
                }
                lines.append(fill(msg, **fill_opts))
                lines.append(fill(html, **fill_opts))
                lines.append(fill(target, **fill_opts))
                lines.append('\n')

        return '\n'.join(lines)
445218
def error(message, code='ERROR'):
    
    now = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
    output = now + ' [' + torn.plugins.colors.FAIL + \
            code + torn.plugins.colors.ENDC + '] \t' + \
            message
    print(output)
1057240
def FormatProblem(self, d=None):
    
    if not d:
      d = self.GetDictToFormat()

    output_error_text = self.__class__.ERROR_TEXT % d
    if ('reason' in d) and d['reason']:
      return '%s\n%s' % (output_error_text, d['reason'])
    else:
      return output_error_text
1078147
def warn(self, msg, whitespace_strp=True):
        
        if self.errors_display:
            if whitespace_strp:
                msg = strip_whitespace(msg)

            if not self.log_to_file:
                msg = colors['warn'] + "[+] " + msg + colors['endc']
            else:
                msg = "[" + time.strftime("%c") + "] " + msg

            self.print(msg, file=self.error_log)
65608
def error(msg, details=None):
    ''''''
    msg = '{0} {1}'.format(red(KO), white(safe_unicode(msg)))
    msg = safe_unicode(msg)
    if details:
        msg = b'\n'.join((msg, safe_unicode(details)))
    echo(format_multiline(msg))
1103746
function formatSassError(err, data) {
  // Generate three-line preview around the error:
  var preview = data.split('\n');
  preview = preview.slice(Math.max(0, err.line-2), Math.min(err.line+1, preview.length-1));
  preview = preview.map(function(src) { return '>>> '+ src });
  preview.unshift(err.message);

  var error = new Error('Error rendering theme Sass:\n'+ preview.join('\n'));
  error.line = err.line || null;
  error.column = err.column || null;
  return error;
}