2
0
mirror of https://github.com/openkmip/pykmip synced 2026-01-04 01:23:25 +00:00

Merge pull request #436 from OpenKMIP/feat/improve-attribute-error-msg

Add a better error message when reading unparseable attributes
This commit is contained in:
Peter Hamilton
2018-05-17 14:13:34 -04:00
committed by GitHub

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)