Create the error messages
326013
def error_messages(yard_coverage, error_text)
      first_message = "You have a #{yard_coverage}% yard documentation coverage. "\
                      "#{config['min_coverage_percentage']}% is the minimum required."

      # Add the undocumented objects text as error messages
      messages = [Overcommit::Hook::Message.new(:error, nil, nil, first_message)]

      errors = error_text.strip.split("\n")
      errors.each do |undocumented_object|
        undocumented_object_message, file_info = undocumented_object.split(/:?\s+/)
        file_info_match = file_info.match(/^\(([^:]+):(\d+)\)/)

        # In case any compacted error does not follow the format, ignore it
        if file_info_match
          file = file_info_match.captures[0]
          line = file_info_match.captures[1]
          messages << Overcommit::Hook::Message.new(
            :error, file, line, "#{file}:#{line}: #{undocumented_object_message}"
          )
        end
      end
      messages
    end
440376
def expected_error_messages(*error_messages):
    
    def wrapper(func):
        setattr(func, EXPECTED_ERROR_MESSAGES, error_messages)
        return func
    return wrapper
56819
function createError (err, target) {
  return { status: 'error', target: target, message: err, timestamp: Date.now() }
}
908654
function (err) {
    "use strict";

    var message = '';

    if (typeof err === 'string') {
      return new Error(err);

    } else if (typeof err === 'object') {

      if (err.cause) {
        // probably a webdriver error
        try {
          message = JSON.parse(err.cause.value.message).errorMessage;
        } catch ($) {
          message = err.cause.value.message;
        }
      } else {
        message = err.message || err.toString();
      }
      return new Error(message);
    }
    return new Error(err.toString());
  }
826620
function makeError(code, message, data = {}) {
  const error = new Error(message);
  return Object.assign(error, {code, data});
}
687643
def write_error(self, status_code, **kwargs):
        """"""
        message = default_message = httplib.responses.get(status_code, '')
        # HTTPError exceptions may have a log_message attribute
        if 'exc_info' in kwargs:
            (_, exc, _) = kwargs['exc_info']
            if hasattr(exc, 'log_message'):
                message = str(exc.log_message) or default_message
        self.logvalue('halt_reason', message)
        title = "{}: {}".format(status_code, default_message)
        body = "{}: {}".format(status_code, message)
        self.finish("<html><title>" + title + "</title>"
                    "<body>" + body + "</body></html>")
212095
def from_errno(cls, errno):
        """"""
        message = '{}: {}'.format(pyuv.errno.errorcode.get(errno, errno),
                                    pyuv.errno.strerror(errno))
        return cls(message, errno)
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)
845452
function makeError(id, msg, err, requireModules) {
      var e = new Error(msg + "\nhttp://requirejs.org/docs/errors.html#" + id);
      e.requireType = id;
      e.requireModules = requireModules;
      if (err) {
        e.originalError = err;
      }
      return e;
    }
678462
function createErrorHandler(verb) {
            return function(err) {
                if (!callback) { return; }
                grunt.verbose.error();
                grunt.fail.warn("Failed to " + verb + ": " + err.message);
                callbackOnce(err);
            };
        }
1149831
function createError (err, src) {
  return { status: 'error', src: src, message: err, timestamp: Date.now() }
}
363225
def warning(self, *args) -> "Err":
        
        error = self._create_err("warning", *args)
        print(self._errmsg(error))
        return error
514068
def _generate_message_error(cls, response_code, messages, response_id):
        

        line_response_code = cls._FORMAT_RESPONSE_CODE_LINE \
            .format(response_code)
        line_response_id = cls._FORMAT_RESPONSE_ID_LINE.format(response_id)
        line_error_message = cls._FORMAT_ERROR_MESSAGE_LINE.format(
            cls._GLUE_ERROR_MESSAGE_STRING_EMPTY.join(messages)
        )

        return cls._glue_all_error_message(
            [line_response_code, line_response_id, line_error_message]
        )
201444
protected function createErrorString()
    {
        $str = '';
        if ( $this->errorType !== null )
        {
            $str .= ", error='{$this->errorType}'";
        }

        if ( $this->errorMessage !== null )
        {
            $str .= ", error_description='{$this->errorMessage}'";
        }
        return $str;
    }
977996
def build_raw_error_message(protocol_exception):
    """"""
    message = ErrorMessage(
        id=protocol_exception.id,
        code=protocol_exception.code,
        tracing=protocol_exception.tracing,
        description=protocol_exception.description,
    )

    return message
1336375
def append(self, error_message):
        
        self.problems = self.problems + error_message.problems
        self.details = self.details + error_message.details
        self.suggestions = self.suggestions + error_message.suggestions
        self.tracebacks.items.extend(error_message.tracebacks.items)
1262439
function errmsg(msg) {
  const obj = this._obj,
        errorMessages = getErrorMessages(obj);
  this.assert(
    _.includes(errorMessages, msg),
    'expected #{this} to have an error message: #{errmsg}',
    'expected #{this} to not an error message: #{errmsg}',
    msg,   // expected
    errorMessages   // actual
  );
}