add error handling

This commit is contained in:
2019-01-02 17:01:10 +01:00
parent 0007f25cf6
commit 3bf1d1f0eb

View File

@@ -48,3 +48,7 @@ def name_show(gameid, player):
other_players.pop(player,None) other_players.pop(player,None)
pprint(other_players) pprint(other_players)
return render_template("name_show.html", current_player=player, other_players=other_players) return render_template("name_show.html", current_player=player, other_players=other_players)
@app.errorhandler(KeyError)
def not_found(error):
return "<h1>Not Found</h1>Object not found <br/> <a href={}>home</a>".format(url_for("create_game")), 404