Skip to content

Commit

Permalink
log web archive issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartthomas25 committed Apr 30, 2024
1 parent bfe24fd commit 1d10026
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions jparty/welcome_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,22 @@ def resizeEvent(self, event):
self.textbox.setFont(f)

def __random(self):
while True:
game_id = get_random_game()
logging.info(f"GAMEID {game_id}")
self.game.data = get_game(game_id)
if self.game.valid_game():
break
else:
time.sleep(0.25)

self.gameid_trigger.emit(str(game_id))
self.summary_trigger.emit(self.game.data.date + "\n" + self.game.data.comments)
try:
while True:
game_id = get_random_game()
logging.info(f"GAMEID {game_id}")
self.game.data = get_game(game_id)
if self.game.valid_game():
break
else:
time.sleep(0.25)

self.gameid_trigger.emit(str(game_id))
self.summary_trigger.emit(self.game.data.date + "\n" + self.game.data.comments)

except Exception as e:
logging.error(e)
self.summary_trigger.emit("Cannot get game")

def random(self, checked):
self.summary_trigger.emit("Loading...")
Expand All @@ -228,7 +233,8 @@ def __show_summary(self):
else:
self.summary_trigger.emit("Game has blank questions")

except Exception:
except Exception as e:
logging.error(e)
self.summary_trigger.emit("Cannot get game")

self.check_start()
Expand Down

0 comments on commit 1d10026

Please sign in to comment.