Пример #1
0
    def handle_exception (self, exception, client = None):
        """
        Handles an unexpected exception that occurs during client processing.

        @param exception (Exception)     The exception raised.
        @param client    (FastcgiClient) The client instance that generated the exception.
        """

        Server.handle_exception(self, exception, client)

        if not client or not client.request_id:
            return

        client._write_record(_StreamRecord(FCGI_STDERR, "Could not process request: Internal error", client.request_id))
        client._write_record(_EndRequestRecord(1, FCGI_REQUEST_COMPLETE, client.request_id))