Skip to content

Commit 730a4a7

Browse files
committed
if one creates a connection, url will be accessed without previously checking its existance, so no meaningfull error message is thrown.
1 parent 50bc658 commit 730a4a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pyArango/connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ class Connection(object) :
6969
def __init__(self, arangoURL = 'http://localhost:8529', username=None, password=None) :
7070
self.databases = {}
7171
if arangoURL[-1] == "/" :
72+
if ('url' not in vars()):
73+
raise Exception("you either need to define `url` or make arangoURL contain an HTTP-Host")
7274
self.arangoURL = url[:-1]
7375
else :
7476
self.arangoURL = arangoURL
@@ -138,4 +140,4 @@ def __getitem__(self, dbName) :
138140
try :
139141
return self.databases[dbName]
140142
except KeyError :
141-
raise KeyError("Can't find any database named : %s" % dbName)
143+
raise KeyError("Can't find any database named : %s" % dbName)

0 commit comments

Comments
 (0)