Archive WSJ articles first, catch KeyboardInterrupt

This commit is contained in:
2019-10-15 21:03:47 +00:00
parent 9c4766a928
commit 810e8c5ead
5 changed files with 26 additions and 11 deletions

View File

@@ -17,6 +17,8 @@ def api(route, ref=None):
if r.status_code != 200:
raise Exception('Bad response code ' + str(r.status_code))
return r.json()
except KeyboardInterrupt:
raise
except BaseException as e:
logging.error('Problem hitting hackernews API: {}'.format(str(e)))
return False