|
|
@@ -1,6 +1,7 @@
|
|
|
from flask import (
|
|
|
Flask,
|
|
|
abort,
|
|
|
+ flash,
|
|
|
redirect,
|
|
|
render_template,
|
|
|
request,
|
|
|
@@ -36,8 +37,12 @@ def new_game():
|
|
|
|
|
|
if not name or not hand_size or not match_count or not turn_count:
|
|
|
raise KeyError
|
|
|
-
|
|
|
- except (KeyError, TypeError) as e:
|
|
|
+ except KeyError as e:
|
|
|
+ app.logger.error(e)
|
|
|
+ app.logger.error("Failed, missing args")
|
|
|
+ flash("Failed to create game, bad arguments")
|
|
|
+ return redirect(url_for("home"))
|
|
|
+ except TypeError as e:
|
|
|
app.logger.error(e)
|
|
|
app.logger.error("Failed, bad args")
|
|
|
return abort(400)
|