Skip to content

Commit

Permalink
Return error message to client when invalid message is sent to vPoller
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Sep 7, 2014
1 parent 6bffce4 commit 18d00df
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/vpoller/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,14 @@ def wait_for_tasks(self):
msg = self.worker_socket.recv_json()
except Exception as e:
logging.warning(
'Invalid client message received, will be ignored: %s',
msg
'Invalid client message received, will be ignored',
)
self.worker_socket.send(_id, zmq.SNDMORE)
self.worker_socket.send(_empty, zmq.SNDMORE)
self.worker_socket.send_json(
{'success': 1, 'msg': 'Invalid message received'}
)
return

# Process task and return result to client
result = self.process_client_msg(msg)
Expand Down

0 comments on commit 18d00df

Please sign in to comment.