Skip to content

Commit

Permalink
Merge pull request #199 from joshuagl/joshuagl/issue194
Browse files Browse the repository at this point in the history
Make check_match() errors more readable for ListOf objects
  • Loading branch information
lukpueh authored Jan 6, 2020
2 parents 536c7f2 + 81cf8fa commit 6664328
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion securesystemslib/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ def __init__(self, schema, min_count=0, max_count=sys.maxsize, list_name='list')
def check_match(self, object):
if not isinstance(object, (list, tuple)):
raise securesystemslib.exceptions.FormatError(
'Expected ' + repr(self._list_name) + ' but got ' + repr(object))
'Expected object of type {} but got type {}'.format(
self._list_name, type(object).__name__))


# Check if all the items in the 'object' list
Expand Down

0 comments on commit 6664328

Please sign in to comment.