-
We use it to display user feedback form on unhandled error (in Is there now some way to get event ID for events captured inside integrations, and not manually? The documentation mentions that |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Facing similar Issue |
Beta Was this translation helpful? Give feedback.
-
This worked for me somehow, no duplicate issues class SentryEventMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = self.get_response(request)
return response
def process_exception(self, request, exception):
event_id = sentry_sdk.capture_exception(exception)
request.sentry_event_id = event_id
def custom500(request, exception=None):
"""Custom 500"""
return JsonResponse(
{
"message": "Internal Server Error",
"code": getattr(request, "sentry_event_id", None),
},
status=500,
) |
Beta Was this translation helpful? Give feedback.
Actually, it is planned, see #3049 and #3057