Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
    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)
Exemple #5
0
    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)
Exemple #6
0
 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)
Exemple #7
0
 def handle_response(self,response):
     headers, content = response
     response_handler = RESPONSE_HANDLERS.get(headers.status)
     response_handler(response)
Exemple #8
0
 def handle_response(self, response):
     headers, content = response
     response_handler = RESPONSE_HANDLERS.get(headers.status)
     response_handler(response)