@@ -73,11 +73,11 @@ async def create_model(request: ModelRequest, authorization: Optional[str] = Hea
7373 except ValueError as e :
7474 logging .error (f"Failed to create model: { str (e )} " )
7575 raise HTTPException (status_code = HTTPStatus .CONFLICT ,
76- detail = "Failed to create model: name conflict" )
76+ detail = str ( e ) )
7777 except Exception as e :
7878 logging .error (f"Failed to create model: { str (e )} " )
7979 raise HTTPException (
80- status_code = HTTPStatus .INTERNAL_SERVER_ERROR , detail = "Failed to create model" )
80+ status_code = HTTPStatus .INTERNAL_SERVER_ERROR , detail = str ( e ) )
8181
8282
8383@router .post ("/provider/create" )
@@ -103,7 +103,7 @@ async def create_provider_model(request: ProviderModelRequest, authorization: Op
103103 except Exception as e :
104104 logging .error (f"Failed to create provider model: { str (e )} " )
105105 raise HTTPException (status_code = HTTPStatus .INTERNAL_SERVER_ERROR ,
106- detail = "Failed to create provider model" )
106+ detail = str ( e ) )
107107
108108
109109@router .post ("/provider/batch_create" )
@@ -129,7 +129,7 @@ async def batch_create_models(request: BatchCreateModelsRequest, authorization:
129129 except Exception as e :
130130 logging .error (f"Failed to batch create models: { str (e )} " )
131131 raise HTTPException (status_code = HTTPStatus .INTERNAL_SERVER_ERROR ,
132- detail = "Failed to batch create models" )
132+ detail = str ( e ) )
133133
134134
135135@router .post ("/provider/list" )
@@ -153,7 +153,7 @@ async def get_provider_list(request: ProviderModelRequest, authorization: Option
153153 except Exception as e :
154154 logging .error (f"Failed to get provider list: { str (e )} " )
155155 raise HTTPException (status_code = HTTPStatus .INTERNAL_SERVER_ERROR ,
156- detail = "Failed to get provider list" )
156+ detail = str ( e ) )
157157
158158
159159@router .post ("/update" )
@@ -179,11 +179,11 @@ async def update_single_model(request: dict, authorization: Optional[str] = Head
179179 except ValueError as e :
180180 logging .error (f"Failed to update model: { str (e )} " )
181181 raise HTTPException (status_code = HTTPStatus .CONFLICT ,
182- detail = "Failed to update model: name conflict" )
182+ detail = str ( e ) )
183183 except Exception as e :
184184 logging .error (f"Failed to update model: { str (e )} " )
185185 raise HTTPException (status_code = HTTPStatus .INTERNAL_SERVER_ERROR ,
186- detail = "Failed to update model" )
186+ detail = str ( e ) )
187187
188188
189189@router .post ("/batch_update" )
@@ -203,7 +203,7 @@ async def batch_update_models(request: List[dict], authorization: Optional[str]
203203 except Exception as e :
204204 logging .error (f"Failed to batch update models: { str (e )} " )
205205 raise HTTPException (status_code = HTTPStatus .INTERNAL_SERVER_ERROR ,
206- detail = "Failed to batch update models" )
206+ detail = str ( e ) )
207207
208208
209209@router .post ("/delete" )
@@ -230,11 +230,11 @@ async def delete_model(display_name: str = Query(..., embed=True), authorization
230230 except LookupError as e :
231231 logging .error (f"Failed to delete model: { str (e )} " )
232232 raise HTTPException (status_code = HTTPStatus .NOT_FOUND ,
233- detail = "Failed to delete model: model not found" )
233+ detail = str ( e ) )
234234 except Exception as e :
235235 logging .error (f"Failed to delete model: { str (e )} " )
236236 raise HTTPException (status_code = HTTPStatus .INTERNAL_SERVER_ERROR ,
237- detail = "Failed to delete model" )
237+ detail = str ( e ) )
238238
239239
240240@router .get ("/list" )
@@ -256,7 +256,7 @@ async def get_model_list(authorization: Optional[str] = Header(None)):
256256 except Exception as e :
257257 logging .error (f"Failed to list models: { str (e )} " )
258258 raise HTTPException (status_code = HTTPStatus .INTERNAL_SERVER_ERROR ,
259- detail = "Failed to retrieve model list" )
259+ detail = str ( e ) )
260260
261261
262262@router .get ("/llm_list" )
@@ -272,7 +272,7 @@ async def get_llm_model_list(authorization: Optional[str] = Header(None)):
272272 except Exception as e :
273273 logging .error (f"Failed to retrieve LLM list: { str (e )} " )
274274 raise HTTPException (status_code = HTTPStatus .INTERNAL_SERVER_ERROR ,
275- detail = "Failed to retrieve LLM list" )
275+ detail = str ( e ) )
276276
277277
278278@router .post ("/healthcheck" )
@@ -296,15 +296,15 @@ async def check_model_health(
296296 except LookupError as e :
297297 logging .error (f"Failed to check model connectivity: { str (e )} " )
298298 raise HTTPException (status_code = HTTPStatus .NOT_FOUND ,
299- detail = "Model configuration not found" )
299+ detail = str ( e ) )
300300 except ValueError as e :
301301 logging .error (f"Invalid model configuration: { str (e )} " )
302302 raise HTTPException (status_code = HTTPStatus .BAD_REQUEST ,
303- detail = "Invalid model configuration" )
303+ detail = str ( e ) )
304304 except Exception as e :
305305 logging .error (f"Failed to check model connectivity: { str (e )} " )
306306 raise HTTPException (status_code = HTTPStatus .INTERNAL_SERVER_ERROR ,
307- detail = "Failed to check model connectivity" )
307+ detail = str ( e ) )
308308
309309
310310@router .post ("/temporary_healthcheck" )
@@ -324,4 +324,4 @@ async def check_temporary_model_health(request: ModelRequest):
324324 except Exception as e :
325325 logging .error (f"Failed to verify model connectivity: { str (e )} " )
326326 raise HTTPException (status_code = HTTPStatus .INTERNAL_SERVER_ERROR ,
327- detail = "Failed to verify model connectivity" )
327+ detail = str ( e ) )
0 commit comments