diff -r 9880bb697149 -r ac07779f788d rest.py --- a/rest.py Mon Jan 19 16:42:36 2015 -0500 +++ b/rest.py Sat Apr 11 21:02:09 2015 +0300 @@ -42,11 +42,9 @@ def throttle (address): tt = datetime.utcnow() + timedelta (0, 30) - try: - # attempt to just update the item + if address in g_throttle: g_throttle[g_throttle.index (address)][1] = tt - except ValueError: - # not in list + else: g_throttle.append ([address, tt]) Irc.broadcast ('Throttling %s for 30 seconds' % address) @@ -104,8 +102,8 @@ with open ('rejected_json.txt', 'w') as fp: fp.write (jsonstring) Irc.broadcast ('bad json written to rejected_json.txt') - except: - Irc.broadcast ('failed to log json') + except Exception as e: + Irc.broadcast ('failed to log json because %s' % e) pass throttle (address)