Skip to content

Commit

Permalink
Add a view that triggers an error for sentry (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
CamLamb authored Jul 9, 2024
1 parent 92219a4 commit c3d056d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.views.decorators.cache import never_cache

from core.utils.urls import decorate_urlpatterns
from core.views import trigger_error

private_urlpatterns: List[Union[URLPattern, URLResolver]] = [
path("", include("core.landing_pages.urls")),
Expand All @@ -20,6 +21,7 @@
public_url_patterns: List[Union[URLPattern, URLResolver]] = [
path("", include("core.health_check.urls")),
path("dit-activity-stream/", include("dit_activity_stream.urls")),
path("sentry-debug/", trigger_error),
]

urlpatterns: List[Union[URLPattern, URLResolver]] = (
Expand Down
4 changes: 4 additions & 0 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ def get_context_data(self, **kwargs):
)

return super().get_context_data(**kwargs)


def trigger_error(request):
division_by_zero = 1 / 0 # noqa: F841

0 comments on commit c3d056d

Please sign in to comment.