From afbf5a2218962b87d81e2bbd102c6b0ecadd287f Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 6 Apr 2018 21:50:13 -0700 Subject: [PATCH] fix python script to catch relay.py errors --- xwords4/linux/scripts/discon_ok2.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xwords4/linux/scripts/discon_ok2.py b/xwords4/linux/scripts/discon_ok2.py index 127eba615..0ea80d543 100755 --- a/xwords4/linux/scripts/discon_ok2.py +++ b/xwords4/linux/scripts/discon_ok2.py @@ -272,7 +272,11 @@ class Device(): def send_dead(self): JSON = json.dumps([{'relayID': self.relayID, 'seed': self.relaySeed}]) url = 'http://%s/xw4/relay.py/kill' % (self.args.HOST) - req = requests.get(url, params = {'params' : JSON}) + params = {'params' : JSON} + try: + req = requests.get(url, params = params) # failing + except requests.exceptions.ConnectionError: + print('got exception sending to', url, params, '; is relay.py running as apache module?') def getTilesCount(self): return {'index': self.indx, 'nTilesLeft': self.nTilesLeft,