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
pull/11213/head
Tomaz Bratanic 8 months ago committed by GitHub
parent d903fa313e
commit 7e4b676d53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -133,12 +133,14 @@ class Neo4jGraph(GraphStore):
# Set schema
try:
self.refresh_schema()
except neo4j.exceptions.ClientError:
raise ValueError(
"Could not use APOC procedures. "
"Please ensure the APOC plugin is installed in Neo4j and that "
"'apoc.meta.data()' is allowed in Neo4j configuration "
)
except neo4j.exceptions.ClientError as e:
if e.code == "Neo.ClientError.Procedure.ProcedureNotFound":
raise ValueError(
"Could not use APOC procedures. "
"Please ensure the APOC plugin is installed in Neo4j and that "
"'apoc.meta.data()' is allowed in Neo4j configuration "
)
raise e
@property
def get_schema(self) -> str:

Loading…
Cancel
Save