Fix error
Browse files
utils.py
CHANGED
|
@@ -113,7 +113,7 @@ async def error_handling_wrapper(generator, status_code=200):
|
|
| 113 |
async for item in wrapped_generator:
|
| 114 |
yield item
|
| 115 |
except HTTPException as http_exc:
|
| 116 |
-
raise http_exc
|
| 117 |
except (httpx.ReadError, asyncio.CancelledError) as e:
|
| 118 |
logger.error(f"Network error during streaming: {e}")
|
| 119 |
raise HTTPException(status_code=503, detail=f"Stream interrupted: {str(e)}")
|
|
|
|
| 113 |
async for item in wrapped_generator:
|
| 114 |
yield item
|
| 115 |
except HTTPException as http_exc:
|
| 116 |
+
raise HTTPException(status_code=status_code, detail=f"Wrapper error: {str(http_exc)}")
|
| 117 |
except (httpx.ReadError, asyncio.CancelledError) as e:
|
| 118 |
logger.error(f"Network error during streaming: {e}")
|
| 119 |
raise HTTPException(status_code=503, detail=f"Stream interrupted: {str(e)}")
|