Skip to content

Commit

Permalink
handle connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
gkorland committed Feb 13, 2024
1 parent 7fcbe8d commit e47f6fe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libs/community/langchain_community/graphs/falkordb_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ def __init__(
"Please install it with `pip install falkordb`."
)

self._driver = FalkorDB(
host=host, port=port, username=username, password=password, ssl=ssl
)
try:
self._driver = FalkorDB(
host=host, port=port, username=username, password=password, ssl=ssl
)
except Exception as e:
raise ConnectionError(f"Failed to connect to FalkorDB: {e}")

self._graph = self._driver.select_graph(database)
self.schema: str = ""
self.structured_schema: Dict[str, Any] = {}
Expand Down

0 comments on commit e47f6fe

Please sign in to comment.