Add a better error message when reading unparseable attributes

This change adds a basic error message that gets raised when
attempting to read an unparseable attribute (i.e., an attribute
that is not supported by the library).

Fixes #429
This commit is contained in:
Peter Hamilton 2018-05-17 13:28:11 -04:00
parent c3319afd67
commit a9afd44a91

View File

@ -112,6 +112,8 @@ class Attribute(Struct):
enum_type = name
value = self.value_factory.create_attribute_value(enum_type, None)
if value is None:
raise Exception("No value type for {}".format(enum_name))
self.attribute_value = value
self.attribute_value.tag = Tags.ATTRIBUTE_VALUE
self.attribute_value.read(tstream)