Create HTTP error
770149
function createError(status, message) {
  var err = new Error(message);
  err.status = status;
  return err;
}
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;
    }
375681
public static function httpErrors()
    {
        return function (callable $handler) {
            return function ($request, array $options) use ($handler) {
                if (empty($options['http_errors'])) {
                    return $handler($request, $options);
                }
                return $handler($request, $options)->then(
                    function (ResponseInterface $response) use ($request) {
                        $code = $response->getStatusCode();
                        if ($code < 400) {
                            return $response;
                        }
                        throw RequestException::create($request, $response);
                    }
                );
            };
        };
    }
719577
def error(self, request, message, extra_tags='', fail_silently=False):
        """"""
        add(self.target_name, request, constants.ERROR, message, extra_tags=extra_tags,
            fail_silently=fail_silently)
737833
function makeHttpErrorClass(code, description) {
  /*****************************************************************************
   * @method C
   * @description C description
   * @param {string} message -- xxx
   * @param {xxx} response -- xxx
   * @returns {xxx} -- xxx
   */
  var C = function(message, response) {
    HttpError.call(this, message, code, description, response, false)
    Error.captureStackTrace(this, arguments.callee)
  }
  util.inherits(C, HttpError)
  C.code = code // Tag class with code as well for convenience

  return C
}
1027972
function makeError(code, text) {
  var err = new Error(text);
  err.code = code;
  return err;
}
702303
def create_http
      http = Net::HTTP.new(
        API_URI.host, 
        API_URI.port
      )
      http.use_ssl = true
      apply_ca_cert_path(http)
      apply_pem(http)
      http
    end
163959
def compose_error_message(http_response, max_len=200)
        msg = http_response.body.gsub("\n", ' ')
        msg = "#{msg[0..max_len]} ..." if msg.size > max_len
        msg
      end
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>")
66522
def create_api_error_from_http_exception(e):
    
    response = e.response
    try:
        explanation = response.json()['message']
    except ValueError:
        explanation = (response.content or '').strip()
    cls = APIError
    if response.status_code == 404:
        if explanation and ('No such image' in str(explanation) or
                            'not found: does not exist or no pull access'
                            in str(explanation) or
                            'repository does not exist' in str(explanation)):
            cls = ImageNotFound
        else:
            cls = NotFound
    raise cls(e, response=response, explanation=explanation)
794732
def _server_error_message(url, message):
    """"""
    msg = _error_message.format(url=url, message=message)
    log.error(msg)
    return msg
1356264
def http_error_default(self, url, fp, errcode, errmsg, headers):
        """"""
        fp.close()
        raise HTTPError(url, errcode, errmsg, headers, None)
291161
function HttpRequestError(nestedError, status, body){

  nestedError = nestedError || null;
  status = status || -1;
  body = body || null;

  superError.call(
    this,
    'HttpRequestError',
    util.format('An error [%s] occurred requesting content from an HTTP source: %s', status, nestedError || body)
  );

  this.status = status;
  this.body = body;
  this.nestedError = nestedError;
}
75133
function error(err, req, res, next) {
  // log it
  if (!test) console.error(err.stack);

  // respond with 500 "Internal Server Error".
  res.status(500);
  res.send('Internal Server Error');
}
213282
function (err) {
    var status = typeof err === 'number' ? err : err.status;

    if (!(err instanceof errors.HTTPError) && status) {
      return errors.create(status, err.message);
    }
    return err;
  }
1016727
function HTTPError(statusCode, data) {
  Error.call(this);
  Error.captureStackTrace(this, this.constructor);

  /**
   * Human-readable error name.
   *
   * @type {String}
   */
  this.name = http.STATUS_CODES[statusCode];

  /**
   * HTTP status code.
   *
   * @type {Number}
   */
  this.statusCode = statusCode;

  /**
   * Any additional data.
   *
   * @type {*}
   */
  this.data = data;

  if (data) {
    // Property of Error.
    this.message = JSON.stringify(data);
  }
}
1203134
def _create_error(self, status_code):
        

        return jsend.error(message=ComodoCA.status_code[status_code], code=status_code)