Skip to content

Commit

Permalink
better error message for non-dict items
Browse files Browse the repository at this point in the history
  • Loading branch information
trehn committed Sep 10, 2017
1 parent dc6f15e commit 895f493
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bundlewrap/items/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ def _test(self):

@classmethod
def _validate_attribute_names(cls, bundle, item_id, attributes):
if not isinstance(attributes, dict):
raise BundleError(_(
"invalid item '{item}' in bundle '{bundle}': not a dict"
).format(
item=item_id,
bundle=bundle.name,
))
invalid_attributes = set(attributes.keys()).difference(
set(cls.ITEM_ATTRIBUTES.keys()).union(
set(BUILTIN_ITEM_ATTRIBUTES.keys())
Expand Down

0 comments on commit 895f493

Please sign in to comment.