mirror of
https://github.com/OpenKMIP/PyKMIP.git
synced 2025-07-23 22:14:25 +02:00
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:
parent
c3319afd67
commit
a9afd44a91
@ -112,6 +112,8 @@ class Attribute(Struct):
|
|||||||
enum_type = name
|
enum_type = name
|
||||||
|
|
||||||
value = self.value_factory.create_attribute_value(enum_type, None)
|
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 = value
|
||||||
self.attribute_value.tag = Tags.ATTRIBUTE_VALUE
|
self.attribute_value.tag = Tags.ATTRIBUTE_VALUE
|
||||||
self.attribute_value.read(tstream)
|
self.attribute_value.read(tstream)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user