def load_upcoming(): di = DatabaseInterface() try: up_matches = getUpcomingMatches(20) for m in up_matches: match_id = m[0] start_time = m[1] if(not di.checkUpcomingMatchInDatabase(match_id)): #li.log(match_id.split('/')[2] + " available", type="success") # weird that the except warrants success. That's fine though try: di.writeMatch(match_id) except LineupIncompleteException as err: #li.log(traceback.format_exc(), type='traceback') pass except WriteMatchException as err: li.log(traceback.format_exc(), type='traceback') pass else: li.log("already collected " + match_id) except Exception as err: li.log(traceback.format_exc(), type='traceback') li.log(type(err).__name__, type='error') del di s.enter(schedule_time, 1, load_upcoming)