Fix a possible bug that occurs when attempting to encode a dictionary (dict) object as a string in a FastAPI application.
Browse files
utils.py
CHANGED
@@ -56,7 +56,7 @@ async def error_handling_wrapper(generator, status_code=200):
|
|
56 |
return new_generator()
|
57 |
except StopAsyncIteration:
|
58 |
# 处理生成器为空的情况
|
59 |
-
return
|
60 |
|
61 |
def post_all_models(token):
|
62 |
all_models = []
|
|
|
56 |
return new_generator()
|
57 |
except StopAsyncIteration:
|
58 |
# 处理生成器为空的情况
|
59 |
+
return "data: {'error': 'No data returned'}\n\n"
|
60 |
|
61 |
def post_all_models(token):
|
62 |
all_models = []
|