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
I created some indexed objects, but in the case one does not exist and one tries to use "single" (index['user_id']["1"].single), the following happens:
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/neo4jrestclient/iterable.py in single(self)
65 def single(self):
66 try:
---> 67 return self[0]
68 except KeyError:
69 return None
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/neo4jrestclient/iterable.py in __getitem__(self, index)
29
30 def __getitem__(self, index):
---> 31 elto = super(Iterable, self).__getitem__(index)
32 if self._attribute:
33 return self._class(elto[self._attribute], update_dict=elto,
IndexError: list index out of range
For example:
I created some indexed objects, but in the case one does not exist and one tries to use "single" (
index['user_id']["1"].single
), the following happens:We can see the code here:
https://github.com/versae/neo4j-rest-client/blob/master/neo4jrestclient/iterable.py#L68
I think what is meant is catching an
IndexError
rather thanKeyError
. Could that be the case?The text was updated successfully, but these errors were encountered: