diff --git a/netflow/ipfix.py b/netflow/ipfix.py index 88c0334..3ff9746 100644 --- a/netflow/ipfix.py +++ b/netflow/ipfix.py @@ -732,10 +732,15 @@ def __init__(self, data, template: List[Union[TemplateField, TemplateFieldEnterp # See comment in IPFIXFieldTypes.get_type_unpack for more information. field_type = IPFIXFieldTypes.by_id(field_type_id) # type: Optional[FieldType] - if not field_type and type(field) is not TemplateFieldEnterprise: - # This should break, since the exporter seems to use a field identifier - # which is not standardized by IANA. - raise NotImplementedError("Field type with ID {} is not implemented".format(field_type_id)) + if not field_type: + if type(field) is not TemplateFieldEnterprise: + # This should break, since the exporter seems to use a field identifier + # which is not standardized by IANA. + raise NotImplementedError("Field type with ID {} is not implemented".format(field_type_id)) + else: + # This should break, since the exporter seems to use a field identifier + # which is not suppored + raise NotImplementedError("Field type with ID {} is not suppored".format(field_type_id)) datatype = field_type.type # type: str discovered_fields.append((datatype, field_type_id))