Skip to content

The agent engineering platform.

fix: complete exception handling for UpstashRedisEntityStore (#31893)

Michael Li8ef01f8444b9
diff --git a/libs/langchain/langchain/memory/entity.py b/libs/langchain/langchain/memory/entity.py
index 861857fa2c..6eb922c79c 100644
--- a/libs/langchain/langchain/memory/entity.py
+++ b/libs/langchain/langchain/memory/entity.py
@@ -126,8 +126,10 @@ class UpstashRedisEntityStore(BaseEntityStore):
try:
self.redis_client = Redis(url=url, token=token)
- except Exception:
- logger.error("Upstash Redis instance could not be initiated.")
+ except Exception as exc:
+ error_msg = "Upstash Redis instance could not be initiated"
+ logger.error(error_msg)
+ raise RuntimeError(error_msg) from exc
self.session_id = session_id
self.key_prefix = key_prefix