|
|
@@ -30,9 +30,13 @@ def new_game():
|
|
|
try:
|
|
|
app.logger.info("Creating game...")
|
|
|
name = request.args["playerName"]
|
|
|
- hand_size = request.args["handSize"]
|
|
|
- match_count = request.args["matchCount"]
|
|
|
- turn_count = request.args["turnCount"]
|
|
|
+ hand_size = int(request.args["handSize"])
|
|
|
+ match_count = int(request.args["matchCount"])
|
|
|
+ turn_count = int(request.args["turnCount"])
|
|
|
+
|
|
|
+ if not name or not hand_size or not match_count or not turn_count:
|
|
|
+ raise KeyError
|
|
|
+
|
|
|
except (KeyError, TypeError) as e:
|
|
|
app.logger.error(e)
|
|
|
app.logger.error("Failed, bad args")
|