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. 91: Information exposure through an exception

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