From ee8922e728d465c553bb0c0c3f35759d18ac8cc7 Mon Sep 17 00:00:00 2001 From: Kilokem Date: Thu, 10 Oct 2024 10:30:02 +0200 Subject: [PATCH] error handeling --- __pycache__/begin.cpython-312.pyc | Bin 812 -> 1235 bytes begin.py | 10 +++- templates/404.html | 92 +++++++++++++++++++++++++++++ templates/500.html | 93 ++++++++++++++++++++++++++++++ 4 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 templates/404.html create mode 100644 templates/500.html diff --git a/__pycache__/begin.cpython-312.pyc b/__pycache__/begin.cpython-312.pyc index 195e063a6dbe923226a1e5a0e6ad4f7b5a7c2d4c..ecc4f9e6081638ca3066e90b293728aac0ee7245 100644 GIT binary patch delta 399 zcmZ3(cA1m!G%qg~0}y=eXHTEPJdsa=@y7}+zY08L9~oOr<`l*7cpL@%QxH>ZdlXzEJFTa2m2AgdIL zK(4#RSCE*V8lRV65}%e|nwL@}1r(G4;?KN5qJiNFx6}-)%iL-gSk#I*fg+h-UL)$3@(xY$|4yIHV8~8040i~K?KMEKTWR5%}j;@w|G*Eit>vx67y1WfGnxW8<}Le zlz<9AZY%DZe1pl$;{yvTqs9k51}4_)jDi;#1t%z9W)%C##K@@rnVEq}`~!&ffen{5 ISRvR>0BOll(*OVf delta 75 zcmcc2xrUAJG%qg~0}#yaU{8O*G?7n&v0ewrMUZ!#NBmSvIR ak_IYd1ma?!$&M^uTpw9j88wPHfdT-z1Q1gI diff --git a/begin.py b/begin.py index a6bbf7c..4c908bf 100644 --- a/begin.py +++ b/begin.py @@ -23,4 +23,12 @@ def user(name): liste = [1,2,3,4,5] return render_template('user.html', name=name, stuff=stuff, - liste=liste) \ No newline at end of file + liste=liste) + +@app.errorhandler(404) +def page_not_found(e): + return render_template('404.html') + +@app.errorhandler(500) +def page_not_found(e): + return render_template('500.html') \ No newline at end of file diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..28f953c --- /dev/null +++ b/templates/404.html @@ -0,0 +1,92 @@ + + + + + + 404 - Page Not Found + + + + +
+
+

404

+

Oops! Page Not Found

+ Error Image +

It looks like the page you are trying to reach doesn't exist.

+

But don't worry, you can go back to the homepage by clicking the button below.

+ Go Home +
+
+ + + diff --git a/templates/500.html b/templates/500.html new file mode 100644 index 0000000..4eefa75 --- /dev/null +++ b/templates/500.html @@ -0,0 +1,93 @@ + + + + + + 500 - Internal Server Error + + + + +
+

500

+

Internal Server Error

+ Error Image +

Something went wrong on our end. We're working on fixing it!

+

Please try again later, or reload the page.

+ Reload Page +
+ + +