From fcfa98cf72304ebf998c7e4cc11e12d86b042899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20Gr=C3=B8n=C3=A5s?= <44143748+sondregronas@users.noreply.github.com> Date: Thu, 1 Aug 2024 02:24:37 +0200 Subject: [PATCH] Update app.py --- BookingSystem/app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BookingSystem/app.py b/BookingSystem/app.py index 5d735d8..68ea8f7 100644 --- a/BookingSystem/app.py +++ b/BookingSystem/app.py @@ -94,14 +94,17 @@ def unauthorized_403(_) -> tuple[flask.Response, int]: @app.errorhandler(404) def page_not_found(_) -> tuple[str, int]: + logger.warning(f'A user tried to access a non-existing page: {flask.request.url}') return flask.render_template('404.html'), 404 @app.errorhandler(418) def teapot(_) -> tuple[flask.Response, int]: + logger.warning(f'A user fell victim to the teapot at {flask.request.url}') return flask.redirect('https://www.youtube.com/watch?v=dQw4w9WgXcQ'), 302 @app.errorhandler(500) def internal_server_error(_) -> tuple[str, int]: + logger.error(f'An internal server error occurred at {flask.request.url}') return flask.render_template('500.html'), 500 @app.route('/robots.txt')