fix: Restore proper logging in _find_relevant_policies() exception handler

- Fix bug where exceptions were swallowed without logging in context_retriever.py
- Restore warning log for policy search failures with sanitized category
- Ensure compliance with PR Compliance ID 3 for robust error handling
- Prevent silent failures that hinder debugging and mask missing policy coverage
This commit is contained in:
KaifAhmad1
2026-02-13 15:25:16 +05:30
parent 7ad48df600
commit c41cc28fff
+1
View File
@@ -2134,6 +2134,7 @@ Answer:"""
except Exception as e:
# Sanitize category for logging (remove sensitive data)
safe_category = category[:20] if category else "unknown"
self.logger.warning(f"Failed to find policies for {safe_category}: {type(e).__name__}")
return policies
# Decision Retrieval Methods