Last-chance handler for exceptions.
(self, request, resolver, exc_info)
| 284 | return None, HttpResponse("413 Payload too large", status=413) |
| 285 | |
| 286 | def handle_uncaught_exception(self, request, resolver, exc_info): |
| 287 | """Last-chance handler for exceptions.""" |
| 288 | # There's no WSGI server to catch the exception further up |
| 289 | # if this fails, so translate it into a plain text response. |
| 290 | try: |
| 291 | return super().handle_uncaught_exception(request, resolver, exc_info) |
| 292 | except Exception: |
| 293 | return HttpResponseServerError( |
| 294 | traceback.format_exc() if settings.DEBUG else "Internal Server Error", |
| 295 | content_type="text/plain", |
| 296 | ) |
| 297 | |
| 298 | async def send_response(self, response, send): |
| 299 | """Encode and send a response out over ASGI.""" |
nothing calls this directly
no test coverage detected