From: genjix Date: Wed, 21 Mar 2012 10:39:50 +0000 (+0000) Subject: Fixed syntax error part for requestor X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=commitdiff_plain;h=947482872efcf6c7a559674e3e50f0d492673bad Fixed syntax error part for requestor --- diff --git a/stratum.py b/stratum.py index 74e5866..8a25065 100644 --- a/stratum.py +++ b/stratum.py @@ -148,15 +148,15 @@ class TcpClientRequestor(threading.Thread): continue try: - message_id = command.get('id') - method = command.get('method') - params = command.get('params') - except: + # Try to load vital fields, and return an error if + # unsuccessful. + message_id = command['id'] + method = command['method'] + except KeyError: + # This should return an error JSON in response. print "syntax error", repr(command), self.session.address[0] - continue - - self.session.push_request((message_id, method, params)) - print message_id, method, params + else: + self.session.push_request(command) class TcpServer(threading.Thread):