Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

Potential fix for code scanning alert no. 90: Information exposure through an exception

Edwin Jose547e6a910cce
diff --git a/src/api/connectors.py b/src/api/connectors.py
index d22e0f7da..80a3feac8 100644
--- a/src/api/connectors.py
+++ b/src/api/connectors.py
@@ -846,7 +846,8 @@ async def ibm_cos_list_buckets(
cos = create_ibm_cos_client(cfg)
buckets = [b["Name"] for b in cos.list_buckets().get("Buckets", [])]
return JSONResponse({"buckets": buckets})
- except Exception as exc:
+ logger.exception("Failed to list IBM COS buckets for connection %s", connection_id)
+ return JSONResponse({"error": "Failed to list buckets"}, status_code=500)
return JSONResponse({"error": f"Failed to list buckets: {exc}"}, status_code=500)