Fix the bug with incomplete error handling.
Browse files
utils.py
CHANGED
|
@@ -109,6 +109,11 @@ async def error_handling_wrapper(generator, status_code=200):
|
|
| 109 |
return new_generator()
|
| 110 |
except StopAsyncIteration:
|
| 111 |
raise HTTPException(status_code=status_code, detail="data: {'error': 'No data returned'}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
def post_all_models(token, config, api_list):
|
| 114 |
all_models = []
|
|
|
|
| 109 |
return new_generator()
|
| 110 |
except StopAsyncIteration:
|
| 111 |
raise HTTPException(status_code=status_code, detail="data: {'error': 'No data returned'}")
|
| 112 |
+
except Exception as e:
|
| 113 |
+
logger.error(f"error_handling_wrapper Exception: {str(e)}")
|
| 114 |
+
import traceback
|
| 115 |
+
logger.error(f"error_handling_wrapper Exception: {traceback.print_exc()}")
|
| 116 |
+
raise HTTPException(status_code=status_code, detail="data: {'error': 'No data returned'}")
|
| 117 |
|
| 118 |
def post_all_models(token, config, api_list):
|
| 119 |
all_models = []
|