Outputs a formatted-red error message.
 @param [String] m The message to output
 @return [void]
499523
def error(m)
      puts _word_wrap(m, '# ').red
      @targets.each { |_, t| t.error(m) }
    end
571156
def error(self, message: str) -> None:
        """"""
        if len(self._custom_error_message) > 0:
            message = self._custom_error_message
            self._custom_error_message = ''

        lines = message.split('\n')
        linum = 0
        formatted_message = ''
        for line in lines:
            if linum == 0:
                formatted_message = 'Error: ' + line
            else:
                formatted_message += '\n       ' + line
            linum += 1

        sys.stderr.write(Fore.LIGHTRED_EX + '{}\n\n'.format(formatted_message) + Fore.RESET)
        # sys.stderr.write('{}\n\n'.format(formatted_message))
        self.print_help()
        sys.exit(1)
718504
def error(self, i: int=None) -> str:
        
        head = "[" + colors.red("error") + "]"
        if i is not None:
            head = str(i) + " " + head
        return head
1164533
function formatError(err, options) {
    options = options || {};
    var name = err.name || err.constructor.name;
    var str = util.format('%s: %s\n', name, err.message);
    if (err.buffer && err.buffer.hexdump) {
        str += err.buffer.hexdump({
            colored: options.color,
            boldStart: false,
            highlight: options.color ? errorHighlighter(err, options) : null
        });
    } else if (Buffer.isBuffer(err.buffer)) {
        if (options.color) {
            str += formatBufferColored(err, options);
        } else {
            str += formatBufferUncolored(err, options);
        }
    }
    return str;
}
154638
def render_error(exception)
      logger.debug "Exception raised: #{exception.class.name}: #{exception.message}" if logger
      # When a normalised class is present, make sure we
      # convert it to a useable error class.
      normalised_class = exception.class.ancestors.detect do |klass|
        klass < StandardError and error_mapping.has_key?(klass)
      end
      if normalised_class
        mapped = error_mapping[normalised_class]
        if mapped.respond_to?(:call)
          exception = mapped.call(exception)
        else
          exception = mapped.new exception.message
        end
      end
      self.status = lookup_error_status(exception)
      render_json({
        :error             => lookup_error_name(exception).to_s,
        :error_description => lookup_error_message(exception)
      }.merge(lookup_error_metadata(exception)))
    end
1143504
def plain_output(message, color)
      if @options['without-color']
        puts message
      else
        puts Colorize.send(color, message)
      end
    end
246844
def format(message, colour = nil, style = nil)
      c = @map[:colour][colour.to_sym] unless colour.nil?

      if style.nil?
        t = 0
      else
        t = @map[:style][style.to_sym]
      end

      "\e[#{t};#{c}m#{message}\e[0m"
    end
585010
def method_missing(method, *args, &block) # :nodoc:
      case method.to_s
      when /^(.*)\?$/
        return !self.send($1.to_s).nil?
      when /^clear_(.*)$/
        self.send("#{$1.to_s}=", nil)
      else
        super
      end
    end
1063261
def _show(self, res, err, prefix='', colored=False):
        

        if self.kind is 'local':
            what = res if not err else err
            print(what)
            return

        if self.kind is 'remote':
            if colored:
                red, green, reset = Fore.RED, Fore.GREEN, Fore.RESET
            else:
                red = green = reset = ''
            if err:
                what = prefix + red + 'remote err: {}'.format(err) + reset
            else:
                what = prefix + green + str(res) + reset
            print(what)
970692
function ErrorMessage({ state, error, clearError }) {
  return (
    <>
      <h1 style={{ color: "red" }}>{error.message}</h1>
      <button onClick={() => clearError()}>Try Again</button>
      <pre>{JSON.stringify(state, null, 2)}</pre>
    </>
  )
}
689512
def error(message, *args, **kwargs):
    

    print('[!] ' + message.format(*args, **kwargs))
    sys.exit(1)
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');
}
753672
function () {
        var prefix = 'ERROR';
        this.output(prefix, prefix.red, Array.prototype.slice.call(arguments));
    }
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
581763
def message_multiline(key)
      begin
        skip_whitespace
        if @scanner.check(/"/)
          add_result(key, message_line)
          message_multiline(key)
        end
      rescue PoSyntaxError => pe
        raise PoSyntaxError, "Syntax error in message_multiline with key '#{key}'\n" + pe.message, pe.backtrace
      end
    end
1352833
def dev_format(errors = @output[:raw_data])
        return if errors.blank?

        pretty_output = ''
        errors.each do |filename, error_list|
          filename = strip_working_dir(filename)
          pretty_output << "\n#{filename.color(:cyan).underline} \n"
          error_list.each do |message|
            pretty_output << severity_color(message['severity'])
            pretty_output << " #{message['line'].to_s.color(:blue)} #{message['linter'].color(:green)}: #{message['reason']} \n"
          end
        end
        pretty_output << "-----\n\n"
        pretty_output
      end
615260
def error(text = "")
      e = /ERROR\s(\d+)\s::\s(.*)/.match(text) || {}
      name = (e[2] || "UnknownError").titleize
      code = e[1] || -1
      error_class = name.gsub(/\s/, "")

      if error_class == "NothingFound"
        []
      else
        begin
          raise Semrush::Exception.const_get(error_class).new(self, "#{name} (#{code})")
        rescue
          raise Semrush::Exception::Base.new(self, "#{name} (#{code}) *** error_class=#{error_class} not implemented ***")
        end
      end
    end