Commit 18a7f587 by kimth

Handle xreply parsing errors more gracefully

parent b6e9e7a4
......@@ -47,7 +47,12 @@ def parse_xreply(xreply):
'content': Message from xqueue (string)
}
'''
xreply = json.loads(xreply)
try:
xreply = json.loads(xreply)
except ValueError, err:
log.error(err)
return (1, 'unexpected reply from server')
return_code = xreply['return_code']
content = xreply['content']
return (return_code, content)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment