コード例 #1
0
ファイル: client.py プロジェクト: matthewwu/PythonRepo
    def handle_response(self, http_resp):
        """
        Check the server response and raise exception if needed.
        
        :param response: httplib2 response: (headers, content).
        :type response: tuple

        :rtype: None

        """
        headers, content = http_resp
        response_handler = RESPONSE_HANDLERS.get(headers.status)
        response_handler(http_resp)
コード例 #2
0
ファイル: client.py プロジェクト: jeromecornet/bulbs
    def handle_response(self, http_resp):
        """
        Check the server response and raise exception if needed.
        
        :param response: httplib2 response: (headers, content).
        :type response: tuple

        :rtype: None

        """
        headers, content = http_resp
        response_handler = RESPONSE_HANDLERS.get(headers.status)
        response_handler(http_resp)
コード例 #3
0
ファイル: client.py プロジェクト: caalle/bulbs
    def handle_response(self,response):
        """
        Handle HTTP server response.
        
        :param response: httplib2 response: (headers, content).
        :type response: tuple

        :rtype: None

        """
        headers, content = response
        response_handler = RESPONSE_HANDLERS.get(headers.status)
        response_handler(response)
コード例 #4
0
ファイル: client.py プロジェクト: nellaivijay/bulbs
    def handle_response(self, response):
        """
        Check the server response and raise exception if needed.
        
        :param response: httplib2 response: (headers, content).
        :type response: tuple

        :rtype: None

        """
        headers, content = response

        # Temporary hack to catch Gremlin Plugin exceptions that return 200 status
        # See https://github.com/neo4j/community/issues/343
        # Example: '"java.lang.IllegalArgumentException: Unknown property type on..."'
        if re.search('^"java.(.*).Exception:', content):
            # raise error...
            server_error(response)

        response_handler = RESPONSE_HANDLERS.get(headers.status)
        response_handler(response)
コード例 #5
0
ファイル: client.py プロジェクト: ct2034/bulbs
    def handle_response(self, response):
        """
        Check the server response and raise exception if needed.
        
        :param response: httplib2 response: (headers, content).
        :type response: tuple

        :rtype: None

        """
        headers, content = response

        # Temporary hack to catch Gremlin Plugin exceptions that return 200 status
        # See https://github.com/neo4j/community/issues/343
        # Example: '"java.lang.IllegalArgumentException: Unknown property type on..."'
        if re.search(b"^\"java.(.*).Exception:", content):
            # raise error...
            server_error(response)

        response_handler = RESPONSE_HANDLERS.get(headers.status)
        response_handler(response)
コード例 #6
0
ファイル: resource.py プロジェクト: zetsub0u/bulbs
 def handle_response(self,http_resp):
     """Handle HTTP server response."""
     headers, content = http_resp
     response_handler = RESPONSE_HANDLERS.get(headers.status)
     response_handler(http_resp)
コード例 #7
0
ファイル: resource.py プロジェクト: reydelamirienda/bulbs
 def handle_response(self,response):
     headers, content = response
     response_handler = RESPONSE_HANDLERS.get(headers.status)
     response_handler(response)
コード例 #8
0
 def handle_response(self, response):
     headers, content = response
     response_handler = RESPONSE_HANDLERS.get(headers.status)
     response_handler(response)