(self, scope: Scope, receive: Receive, send: Send)
| 45 | self._exception_handlers[exc_class_or_status_code] = handler |
| 46 | |
| 47 | async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: |
| 48 | if scope["type"] not in ("http", "websocket"): |
| 49 | await self.app(scope, receive, send) |
| 50 | return |
| 51 | |
| 52 | scope["starlette.exception_handlers"] = ( |
| 53 | self._exception_handlers, |
| 54 | self._status_handlers, |
| 55 | ) |
| 56 | |
| 57 | conn: Request | WebSocket |
| 58 | if scope["type"] == "http": |
| 59 | conn = Request(scope, receive, send) |
| 60 | else: |
| 61 | conn = WebSocket(scope, receive, send) |
| 62 | |
| 63 | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) |
| 64 | |
| 65 | async def http_exception(self, request: Request, exc: Exception) -> Response: |
| 66 | assert isinstance(exc, HTTPException) |
nothing calls this directly
no test coverage detected