sforkowany z mtyton/comfy
'Page not found' error capture
rodzic
8cb78467ff
commit
f38b295fa2
|
@ -26,6 +26,8 @@ sentry_sdk.init(
|
|||
traces_sample_rate=0
|
||||
)
|
||||
|
||||
SENTRY_ENVIRONMENT = os.environ.get("SENTRY_ENVIRONMENT", '')
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
from django.conf import settings
|
||||
from django.http import HttpResponseNotFound
|
||||
from sentry_sdk import capture_message
|
||||
|
||||
|
||||
def my_custom_page_not_found_view(*args, **kwargs):
|
||||
capture_message("Page not found!", level="error")
|
||||
if settings.SENTRY_ENVIRONMENT != 'production':
|
||||
capture_message("Page not found!", level="error")
|
||||
|
||||
# return any response here, e.g.:
|
||||
return HttpResponseNotFound("Not found")
|
||||
|
|
Ładowanie…
Reference in New Issue