Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /fief-dev_fief /fief /apps /dashboard /exception_handlers.py
| from collections.abc import Callable | |
| from fastapi import Request | |
| from starlette.exceptions import HTTPException as StarletteHTTPException | |
| from fief.templates import templates | |
| exception_handlers: dict[type[Exception], Callable] = {} | |
| async def http_exception_handler(request: Request, exc: StarletteHTTPException): | |
| headers = getattr(exc, "headers", None) | |
| return templates.TemplateResponse( | |
| request, | |
| "admin/error.html", | |
| { | |
| "status_code": exc.status_code, | |
| "detail": exc.detail, | |
| }, | |
| status_code=exc.status_code, | |
| headers=headers, | |
| ) | |
| exception_handlers[StarletteHTTPException] = http_exception_handler | |
| __all__ = ["exception_handlers"] | |
Xet Storage Details
- Size:
- 718 Bytes
- Xet hash:
- 9bdc6ba404312ef769b82e99d943dea5d0052b629090468a9d23211159b49ea8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.