neo4j: Print an error message when the server is down.
authorJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Wed, 29 Oct 2014 18:54:03 +0000 (14:54 -0400)
committerJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Thu, 30 Oct 2014 13:50:24 +0000 (09:50 -0400)
Show the message as expected.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

lib/neo4j/neo4j.nit

index 385b966..6629b80 100644 (file)
@@ -115,9 +115,8 @@ class Neo4jClient
        init(base_url: String) do
                self.base_url = base_url
                var root = service_root
-               if not root isa JsonObject then
-                       print "Neo4jClientError: cannot connect to server at {base_url}"
-                       abort
+               assert root isa JsonObject else
+                       sys.stderr.write "Neo4jClientError: cannot connect to server at <{base_url}>.\n"
                end
                self.node_url = root["node"].to_s
                self.batch_url = root["batch"].to_s