mirror of
https://github.com/fastapi/fastapi.git
synced 2026-01-24 14:02:49 -05:00
📝 Update default error response in SQL tutorial
This commit is contained in:
@@ -67,7 +67,7 @@ def read_user(user_id: int, db: Session = Depends(get_db)):
|
||||
|
||||
@app.middleware("http")
|
||||
async def db_session_middleware(request: Request, call_next):
|
||||
response = Response('', status_code=500)
|
||||
response = Response("Internal server error", status_code=500)
|
||||
try:
|
||||
request.state.db = SessionLocal()
|
||||
response = await call_next(request)
|
||||
|
||||
Reference in New Issue
Block a user