Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adafruit_magtag/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def json_traverse(json, path):
for x in path:
try:
value = value[x]
except TypeError as error:
except (TypeError, KeyError) as error:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want IndexError as well? I think that would cover lists. KeyError is for dicts I believe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll add that too.

raise ValueError(
"The specified json_path was not found in the results."
) from error
Expand Down