Skip to content

Commit 12bd86f

Browse files
committed
Change error message when using wrong scheme
1 parent e666b27 commit 12bd86f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

neo4j/v1/session.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ class Driver(object):
8989
def __init__(self, url, **config):
9090
self.url = url
9191
parsed = urlparse(self.url)
92-
if parsed.scheme == "bolt":
92+
transports = ['bolt']
93+
if parsed.scheme in transports:
9394
self.host = parsed.hostname
9495
self.port = parsed.port
9596
else:
96-
raise ValueError("Unsupported URL scheme: %s" % parsed.scheme)
97+
raise ProtocolError("Unsupported transport: '%s' in url: '%s'. Supported transports are: '%s'." %
98+
(parsed.scheme, url, transports))
9799
self.config = config
98100
self.max_pool_size = config.get("max_pool_size", DEFAULT_MAX_POOL_SIZE)
99101
self.session_pool = deque()

0 commit comments

Comments
 (0)