Skip to content

Commit fed451c

Browse files
authored
Merge pull request #25 from makermelissa/main
Handle bad indices in the json_path
2 parents 9460ebd + 1800aff commit fed451c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_magtag/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def json_traverse(json, path):
139139
for x in path:
140140
try:
141141
value = value[x]
142-
except TypeError as error:
142+
except (TypeError, KeyError, IndexError) as error:
143143
raise ValueError(
144144
"The specified json_path was not found in the results."
145145
) from error

0 commit comments

Comments
 (0)