diff --git a/tiny0/database.db b/tiny0/database.db index ef1ce4c..eaf63e0 100644 Binary files a/tiny0/database.db and b/tiny0/database.db differ diff --git a/tiny0/routes.py b/tiny0/routes.py index 3aa8764..d59e19d 100644 --- a/tiny0/routes.py +++ b/tiny0/routes.py @@ -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) \ No newline at end of file + 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 \ No newline at end of file diff --git a/tiny0/static/style.css b/tiny0/static/style.css index 9e17415..d5a3feb 100644 --- a/tiny0/static/style.css +++ b/tiny0/static/style.css @@ -11,8 +11,6 @@ body { .headers { position: absolute; - margin-left: auto; - margin-right: auto; left: 0; right: 0; top: 3vh; @@ -40,8 +38,6 @@ body { .container { position: absolute; - margin-left: auto; - margin-right: auto; left: 0; right: 0; background-color: #2c2c2c; @@ -86,7 +82,7 @@ body { border-color: #7b59a5; } -.error-message { +.url-error-message { color: #ffffff; text-align: center; font-size: 100%; @@ -94,6 +90,15 @@ body { margin: 3% 0 0 0; } +.error-message { + position: absolute; + left: 0; + right: 0; + color: #ffffff; + text-align: center; + margin: 40vh auto 0 auto; +} + .page-container { position: relative; min-height: 100vh; diff --git a/tiny0/templates/error.html b/tiny0/templates/error.html new file mode 100644 index 0000000..f91b805 --- /dev/null +++ b/tiny0/templates/error.html @@ -0,0 +1,13 @@ +{% extends "layout.html" %} + +{% block body %} +
+