fix(translate): add EXPLORE logging for LLM JSON parse failures
Preview + executor now log the raw LLM response (first 1000 chars) when JSON parsing fails, enabling debugging of malformed LLM output. Previously ValueErrors from JSON parse failures were silently returned as 400 without any diagnostic data in logs.
This commit is contained in:
@@ -51,6 +51,7 @@ async def preview_translation(
|
||||
)
|
||||
return result
|
||||
except ValueError as e:
|
||||
logger.explore("preview_translation validation failed", extra={"src": "translate_routes", "error": str(e)})
|
||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
|
||||
except Exception as e:
|
||||
logger.explore("preview_translation failed", extra={"src": "translate_routes", "error": str(e)})
|
||||
|
||||
Reference in New Issue
Block a user