From a98bc941d24ebd8bfee0cb746af7ce3fc92c23ae Mon Sep 17 00:00:00 2001 From: ValueOn AG Date: Tue, 4 Nov 2025 21:34:00 +0100 Subject: [PATCH] intergation validation passed for automation --- modules/aicore/aicorePluginAnthropic.py | 10 ++++++++-- modules/interfaces/interfaceAiObjects.py | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/aicore/aicorePluginAnthropic.py b/modules/aicore/aicorePluginAnthropic.py index f354979c..c26bdaf2 100644 --- a/modules/aicore/aicorePluginAnthropic.py +++ b/modules/aicore/aicorePluginAnthropic.py @@ -219,8 +219,14 @@ class AiAnthropic(BaseConnectorAi): ) except Exception as e: - logger.error(f"Error calling Anthropic API: {str(e)}") - raise HTTPException(status_code=500, detail=f"Error calling Anthropic API: {str(e)}") + error_msg = str(e) if str(e) else f"{type(e).__name__}" + error_detail = f"Error calling Anthropic API: {error_msg}" + if hasattr(e, 'detail') and e.detail: + error_detail += f" | Detail: {e.detail}" + if hasattr(e, 'status_code'): + error_detail += f" | Status: {e.status_code}" + logger.error(error_detail, exc_info=True) + raise HTTPException(status_code=500, detail=error_detail) async def callAiImage(self, modelCall: AiModelCall) -> AiModelResponse: """ diff --git a/modules/interfaces/interfaceAiObjects.py b/modules/interfaces/interfaceAiObjects.py index fc5899dd..2562028c 100644 --- a/modules/interfaces/interfaceAiObjects.py +++ b/modules/interfaces/interfaceAiObjects.py @@ -350,7 +350,13 @@ class AiObjects: except Exception as e: lastError = e - logger.warning(f"❌ Model {model.name} failed for content part: {str(e)}") + error_msg = str(e) if str(e) else f"{type(e).__name__}" + error_detail = f"❌ Model {model.name} failed for content part: {error_msg}" + if hasattr(e, 'detail') and e.detail: + error_detail += f" | Detail: {e.detail}" + if hasattr(e, 'status_code'): + error_detail += f" | Status: {e.status_code}" + logger.warning(error_detail, exc_info=True) if attempt < len(failoverModelList) - 1: logger.info(f"🔄 Trying next failover model...")