From 3bf1d1f0ebcb0c629caad9e8bb604b13af9b30cd Mon Sep 17 00:00:00 2001 From: Yannik Enss Date: Wed, 2 Jan 2019 17:01:10 +0100 Subject: [PATCH] add error handling --- werbinich.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/werbinich.py b/werbinich.py index 9caa788..d6e0d0c 100644 --- a/werbinich.py +++ b/werbinich.py @@ -48,3 +48,7 @@ def name_show(gameid, player): other_players.pop(player,None) pprint(other_players) return render_template("name_show.html", current_player=player, other_players=other_players) + +@app.errorhandler(KeyError) +def not_found(error): + return "

Not Found

Object not found
home".format(url_for("create_game")), 404