File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,10 +62,12 @@ def register_routers(app: FastAPI) -> None:
6262
6363### Registration Logs
6464- Логи захватывают все исключения возникшие в системе
65- и с помошью дисперичизации распределяется по нужным ** file.log**
65+ и с помошью диспечиризации распределяется по нужным ** file.log**
6666``` python
6767# app_includes/logs_errors.py
6868from fastapi import FastAPI
69+ from fastapi.responses import JSONResponse
70+
6971from api_v1.exeptions import ValidationError
7072
7173
Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ async def lifespan(app: FastAPI):
4343 yield
4444 await conn .run_sync (BaseModel .metadata .drop_all )
4545
46- app = FastAPI (docs_url = None , redoc_url = None )
46+ app = FastAPI (docs_url = None ,
47+ redoc_url = None ,
48+ lifespan = lifespan ,
49+ )
4750 register_routers (app = app )
4851 app .dependency_overrides [db_connection .session_geter ] = override_get_async_session
4952
You can’t perform that action at this time.
0 commit comments