From ea17fa53c9fdb74b6439ddb129c4debf2dc711a9 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 11 Sep 2022 04:27:27 +0200 Subject: [PATCH] stop the error spam --- files/routes/casino.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/files/routes/casino.py b/files/routes/casino.py index 56677e35a..7e0999d67 100644 --- a/files/routes/casino.py +++ b/files/routes/casino.py @@ -87,13 +87,16 @@ def pull_slots(v): def blackjack_deal_to_player(v): if v.rehab: return {"error": "You are under Rehab award effect!"} - wager = int(request.values.get("wager")) - currency = request.values.get("currency") - create_new_game(v, wager, currency) - state = dispatch_action(v, BlackjackAction.DEAL) - feed = get_game_feed('blackjack') + try: + wager = int(request.values.get("wager")) + currency = request.values.get("currency") + create_new_game(v, wager, currency) + state = dispatch_action(v, BlackjackAction.DEAL) + feed = get_game_feed('blackjack') - return {"success": True, "state": state, "feed": feed} + return {"success": True, "state": state, "feed": feed} + except Exception as error: + return {"error": error} @app.post("/casino/twentyone/hit")