File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,17 @@ driver.close();
6868// Create a driver instance, for the user neo4j with password neo4j.
6969var driver = neo4j .driver (" bolt://localhost" , neo4j .auth .basic (" neo4j" , " neo4j" ));
7070
71+ // Register a callback to know if driver creation was successful:
72+ driver .onCompleted = function () {
73+ // proceed with using the driver, it was successfully instantiated
74+ };
75+
76+ // Register a callback to know if driver creation failed.
77+ // This could happen due to wrong credentials or database unavailability:
78+ driver .onError = function (error ) {
79+ console .log (' Driver instantiation failed' , error);
80+ };
81+
7182// Create a session to run Cypher statements in.
7283// Note: Always make sure to close sessions when you are done using them!
7384var session = driver .session ();
You can’t perform that action at this time.
0 commit comments