From 56783e79cdfb5c58a108f55550caa27ab395255b Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 25 Mar 2023 21:14:42 +0100 Subject: [PATCH] Add error check view --- src/common/urls.py | 7 ++++--- src/common/views.py | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/common/urls.py b/src/common/urls.py index da64f49..754060c 100644 --- a/src/common/urls.py +++ b/src/common/urls.py @@ -1,9 +1,10 @@ from django.urls import path -from common.views import home, ping +from common import views app_name = "common" urlpatterns = [ - path("ping/", ping, name="ping"), - path("", home, name="home"), + path("error_check/", views.error_check, name="error_check"), + path("ping/", views.ping, name="ping"), + path("", views.home, name="home"), ] diff --git a/src/common/views.py b/src/common/views.py index 6343d26..f581f40 100644 --- a/src/common/views.py +++ b/src/common/views.py @@ -7,3 +7,8 @@ def home(_request): def ping(request): return render(request, "common/ping.html", {}) + + +def error_check(_request): + msg = "Error check" + raise ValueError(msg)