You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vga91
changed the title
Better error messaging in vectordb procedures
Better error messaging with apoc.vectordb.weaviate.createCollection procedure
Jun 28, 2024
Currently, it does not seem possible to solve the issue by acting on APOC Extended, it would be necessary to modify APOC Core.
The following solution (i.e. the one provided in the internal APOC core Trello with id G2oExgfb) would solve the issue:
// placed in StreamCollection.UrlStreamConnection class by replacing the present method
@Override
public InputStream getInputStream() throws IOException {
if (con instanceof HttpURLConnection httpConn && httpConn.getResponseCode() >= 400)
{
// return ErrorStream as a RuntimeException
String errMsg = new String(httpConn.getErrorStream().readAllBytes());
throw new RuntimeException("Error during HTTP call:\n" + errMsg);
}
return toLimitedIStream(con.getInputStream(), getLength());
}
By returning the following output in case of an existing collection:
org.neo4j.graphdb.QueryExecutionException:
Failed to invoke procedure `apoc.vectordb.weaviate.createCollection`: Caused by: java.lang.RuntimeException: Error during HTTP call:
{"error":[{"message":"class name \"TestCollection\" already exists"}]}
Examples of test case to update after the above fixes: 99e6025
vga91
changed the title
Better error messaging with apoc.vectordb.weaviate.createCollection procedure
Better error messaging with vectordb procedures
Jul 1, 2024
The following procedure should return the root cause (i.e. the collection already exists):
Procedure errors to handle and improve:
The text was updated successfully, but these errors were encountered: