(exc_handlers: ExceptionHandlers, exc: Exception)
| 14 | |
| 15 | |
| 16 | def _lookup_exception_handler(exc_handlers: ExceptionHandlers, exc: Exception) -> ExceptionHandler | None: |
| 17 | for cls in type(exc).__mro__: |
| 18 | if cls in exc_handlers: |
| 19 | return exc_handlers[cls] |
| 20 | return None |
| 21 | |
| 22 | |
| 23 | def wrap_app_handling_exceptions(app: ASGIApp, conn: Request | WebSocket) -> ASGIApp: |