Added error handlers

This commit is contained in:
xemeds
2020-07-20 17:51:52 +00:00
parent c5f3f5a8c4
commit b6ed78c8ad
5 changed files with 35 additions and 7 deletions
+11 -1
View File
@@ -41,4 +41,14 @@ def short_url(token):
# Else if the query response contained data
else:
# Redirect to the url of the token
return redirect(query.url)
return redirect(query.url)
# Error handling routes
@app.errorhandler(404)
def error_404(error):
return render_template("error.html", error_message="404 Not Found"), 404
@app.errorhandler(500)
def error_500(error):
return render_template("error.html", error_message="500 Internal Server Error"), 500