mirror of
https://github.com/hwchase17/langchain
synced 2024-11-18 09:25:54 +00:00
community[patch]: Better error propagation for neo4jgraph (#17190)
There are other errors that could happen when refreshing the schema, so we want to propagate specific errors for more clarity
This commit is contained in:
parent
d903fa313e
commit
7e4b676d53
@ -133,12 +133,14 @@ class Neo4jGraph(GraphStore):
|
|||||||
# Set schema
|
# Set schema
|
||||||
try:
|
try:
|
||||||
self.refresh_schema()
|
self.refresh_schema()
|
||||||
except neo4j.exceptions.ClientError:
|
except neo4j.exceptions.ClientError as e:
|
||||||
|
if e.code == "Neo.ClientError.Procedure.ProcedureNotFound":
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Could not use APOC procedures. "
|
"Could not use APOC procedures. "
|
||||||
"Please ensure the APOC plugin is installed in Neo4j and that "
|
"Please ensure the APOC plugin is installed in Neo4j and that "
|
||||||
"'apoc.meta.data()' is allowed in Neo4j configuration "
|
"'apoc.meta.data()' is allowed in Neo4j configuration "
|
||||||
)
|
)
|
||||||
|
raise e
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def get_schema(self) -> str:
|
def get_schema(self) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user