Exemplo n.º 1
0
    def processRequest(self, client_address, request):
        client = self.getClient(client_address)
        try:
            service = self.services[request.command]
        except KeyError:
            self.error("Client %s called an unknown command: %s" % (unicode(client), request.command))
            return Response(u'error', "unknown command: %s" % request.command)

        text = "Call %s(%s)" % (request.command, request.arguments)
        client.debug(text)
        try:
            response = service(client, *request.arguments)
        except Exception, err:
            errmsg = exceptionAsUnicode(err)
            self.writeError(err, "Error when the client %s called %s()" % (unicode(client), request.command))
            return Response(u'error', errmsg)
Exemplo n.º 2
0
 def exception(self, err, title=None):
     text = exceptionAsUnicode(err)
     self.errorPopup(text, title)