diff --git a/src/ai_client.py b/src/ai_client.py index 1a87555b..37c9d758 100644 --- a/src/ai_client.py +++ b/src/ai_client.py @@ -329,7 +329,7 @@ def _classify_deepseek_error(exc: Exception, source: str = "ai_client.deepseek") err_data = exc.response.json() if "error" in err_data: body = str(err_data["error"].get("message", exc.response.text)) else: body = exc.response.text - except: + except (ValueError, AttributeError): body = exc.response.text else: body = str(exc) @@ -352,7 +352,7 @@ def _classify_minimax_error(exc: Exception, source: str = "ai_client.minimax") - err_data = exc.response.json() if "error" in err_data: body = str(err_data["error"].get("message", exc.response.text)) else: body = exc.response.text - except: + except (ValueError, AttributeError): body = exc.response.text else: body = str(exc)