Merge pull request 'fix' (#31) from master into prod

Reviewed-on: #31
This commit is contained in:
emmatveev 2024-12-28 15:53:59 +03:00
commit 5eea888f3d

View File

@ -14,6 +14,13 @@ app.include_router(take.router)
app.include_router(put.router)
app.include_router(finish.router)
@app.exception_handler(Exception)
async def unicorn_exception_handler(request: fastapi.Request, exc: Exception):
return fastapi.JSONResponse(
status_code=500,
content={"message": f"Oops! {exc.name} did something. There goes a rainbow... {exc}"},
)
mongo.create_indexes()