Fixing bug: Error handling response
Browse files
utils.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import json
|
2 |
-
from fastapi import HTTPException
|
3 |
-
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
4 |
|
5 |
from log_config import logger
|
6 |
|
@@ -89,7 +88,7 @@ async def error_handling_wrapper(generator, status_code=200):
|
|
89 |
first_item_str = first_item_str[6:]
|
90 |
elif first_item_str.startswith("data:"):
|
91 |
first_item_str = first_item_str[5:]
|
92 |
-
if first_item_str
|
93 |
logger.error("error_handling_wrapper [DONE]!")
|
94 |
raise StopAsyncIteration
|
95 |
try:
|
|
|
1 |
import json
|
2 |
+
from fastapi import HTTPException
|
|
|
3 |
|
4 |
from log_config import logger
|
5 |
|
|
|
88 |
first_item_str = first_item_str[6:]
|
89 |
elif first_item_str.startswith("data:"):
|
90 |
first_item_str = first_item_str[5:]
|
91 |
+
if first_item_str.startswith("[DONE]"):
|
92 |
logger.error("error_handling_wrapper [DONE]!")
|
93 |
raise StopAsyncIteration
|
94 |
try:
|