Raise remote status error

 @return [undefined]

 @api private
767926
def raise_status_error
      message = format(
        'expected response stati: %s but got: %s, remote message: %s',
        expected_response_stati,
        response.status,
        remote_message.inspect
      )
      fail ProtocolError, message
    end
1317394
def _raise_for_status(response):
    '''
    
    '''
    http_error_msg = ""

    if 400 <= response.status_code < 500:
        http_error_msg = "{0} Client Error: {1}".format(response.status_code,
                                                        response.reason)

    elif 500 <= response.status_code < 600:
        http_error_msg = "{0} Server Error: {1}".format(response.status_code,
                                                        response.reason)

    if http_error_msg:
        try:
            more_info = response.json().get("message")
        except ValueError:
            more_info = None
        if more_info and more_info.lower() != response.reason.lower():
            http_error_msg += ".\n\t{0}".format(more_info)
        raise requests.exceptions.HTTPError(http_error_msg, response=response)
311470
def check(*args)
      raise_authentication_error unless authenticated?
      params = arguments(args, required: [:client_id, :access_token]).params

      if arguments.client_id
        begin
          get_request("/applications/#{arguments.client_id}/tokens/#{arguments.access_token}", params)
        rescue Github::Error::NotFound
          nil
        end
      else
        raise raise_app_authentication_error
      end
    end
526159
def raise_for_status(self, allow_redirects=True):
        """"""

        if self.status_code == 304:
            return
        elif self.error:
            if self.traceback:
                six.reraise(Exception, Exception(self.error), Traceback.from_string(self.traceback).as_traceback())
            http_error = HTTPError(self.error)
        elif (self.status_code >= 300) and (self.status_code < 400) and not allow_redirects:
            http_error = HTTPError('%s Redirection' % (self.status_code))
        elif (self.status_code >= 400) and (self.status_code < 500):
            http_error = HTTPError('%s Client Error' % (self.status_code))
        elif (self.status_code >= 500) and (self.status_code < 600):
            http_error = HTTPError('%s Server Error' % (self.status_code))
        else:
            return

        http_error.response = self
        raise http_error
1230743
def validate(response)
      case response.code
        when 400; raise Error::BadRequest.new error_message(response)
        when 401; raise Error::Unauthorized.new error_message(response)
        when 403; raise Error::Forbidden.new error_message(response)
        when 404; raise Error::NotFound.new error_message(response)
        when 405; raise Error::MethodNotAllowed.new error_message(response)
        when 409; raise Error::Conflict.new error_message(response)
        when 500; raise Error::InternalServerError.new error_message(response)
        when 502; raise Error::BadGateway.new error_message(response)
        when 503; raise Error::ServiceUnavailable.new error_message(response)
      end

      response.parsed_response
    end
731202
def raise_error(self, status=500, message="Generic server error.  Out of luck..."):
        
        self.set_status(status)
        self.write({"message" : message,
                    "status" : status})
1303017
function errorRateLimitExceeded(res) {
  var err = new Error('GitHub rate limit exceeded.');
  err.res = res;
  err.remote = 'github-content-api';
  throw err;
}
633063
def raise_for_status(self):
        
        if not self.ok:
            reason = self.reason or 'No response from %s' % self.url
            if not self.status_code:
                raise HttpConnectionError(reason, response=self)

            if 400 <= self.status_code < 500:
                http_error_msg = '%s Client Error - %s - %s %s' % (
                    self.status_code, reason, self.request.method, self.url)
            else:
                http_error_msg = '%s Server Error - %s - %s %s' % (
                    self.status_code, reason, self.request.method, self.url)

            raise HttpRequestException(http_error_msg, response=self)
38392
function setErrorStatus (error, status) {
  if (!error.status && !error.statusCode) {
    error.status = status
    error.statusCode = status
  }
}
886777
def secondary_status
      session.cluster.with_secondary do |secondary|
        secondary.command(:admin, replSetGetStatus: 1)
      end
    rescue => e
      raise ConnectionFailed, e
    end
88397
def get_status
      status = @http.aget(PredictionIO::AsyncRequest.new('/')).get
      begin
        status.body
      rescue
        status
      end
    end
1213832
def check_response(res, options)
      if res.status >= 200 && res.status <= 299
        if(options[:mashify] && res.body.instance_of?(Hash))
          Hashie::Mash.new(res.body)
        else
          res.body
        end
      elsif [404, 410].include? res.status
        err_str = "Error processing request: (#{res.status})! #{res.env[:method]} URL: #{res.env[:url]}"
        err_str << "\n Resp Body: #{res.body}"
        raise RequestError::NotFound.new(res), err_str
      else
        err_str = "Error processing request (#{res.status})! #{res.env[:method]} URL: #{res.env[:url]}"
        err_str << "\n Resp Body: #{res.body}"
        raise RequestError.new(res), err_str
      end
    end
399706
def check
      refresh
      primary_status = self.primary_status
      secondary_status = self.secondary_status
      mark_message "Connected to #{session.cluster.nodes.count} nodes in mongodb replica set '#{primary_status['set']}'"
    rescue ConnectionFailed => e
      mark_failure
      mark_message "Error: '#{e}'"
    end
251580
def _remote_status(session, service_id, uuid, url, interval=3):
    """"""
    _LOGGER.info('polling for status')
    resp = session.get(url, params={
        'remoteServiceRequestID':service_id,
        'uuid':uuid
    }).json()
    if resp['status'] == 'SUCCESS':
        return 'completed'
    time.sleep(interval)
    return _remote_status(session, service_id, uuid, url)
201946
def _raise_error_if_disconnected(self) -> None:
        
        if (
            self.transport is None
            or self.protocol is None
            or self.transport.is_closing()
        ):
            self.close()
            raise SMTPServerDisconnected("Disconnected from SMTP server")
304801
function RemoteError(error) {
    /**
     * @member {string} message A message detailing the error.
     * @memberof module:rodosha/messages~RemoteError
     * @instance
     */
    var message = error.message || "Unknown error";
    var name = "RemoteError" + (error.name ? ("[" + error.name + "]") : "");
    Error.call(message);

    /* Inject properties */
    this.message = message;
    this.name = name;
    this.toString = function() {
      return name + ": " + message;
    }

    /**
     * @member {string} stack The stack trace associated with this instance,
     *                        combining both local and remote details.
     * @memberof module:rodosha/messages~RemoteError
     * @instance
     */
    var localStack = this.stack || new Error().stack;
    if (localStack) localStack = localStack.replace(/^(Remote)?Error\n/, '');

    if ((error.stack) || (localStack)) {
      var stack = this.toString();
      if (error.stack) stack += "\n- Remote stack:\n" + error.stack;
      if (localStack)  stack += "\n- Local stack:\n"  + localStack;
      this.stack = stack;
    }

  }
216434
def remove_remote(name)
      remote = @remotes[name]
      raise UndefinedRemoteError.new(name) if remote.nil?
      remote.remove
      @remotes[name] = nil
    end