Optimize log display
Browse files
main.py
CHANGED
@@ -136,6 +136,15 @@ class ModelRequestHandler:
|
|
136 |
try:
|
137 |
response = await process_request(request, provider)
|
138 |
return response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
except Exception as e:
|
140 |
print('\033[31m')
|
141 |
print(f"Error with provider {provider['provider']}: {str(e)}")
|
|
|
136 |
try:
|
137 |
response = await process_request(request, provider)
|
138 |
return response
|
139 |
+
except HTTPException as e:
|
140 |
+
print('\033[31m')
|
141 |
+
print(f"Error with provider {provider['provider']}: {str(e)}")
|
142 |
+
traceback.print_exc()
|
143 |
+
print('\033[0m')
|
144 |
+
if use_round_robin:
|
145 |
+
continue
|
146 |
+
else:
|
147 |
+
raise HTTPException(status_code=500, detail="Error: Current provider response failed!")
|
148 |
except Exception as e:
|
149 |
print('\033[31m')
|
150 |
print(f"Error with provider {provider['provider']}: {str(e)}")
|