Test for unsupported formats after testing for supported formats.

This commit is contained in:
Bill Mitchell 2018-02-09 19:59:38 -06:00
parent e73d1e9a2d
commit 264d19b8b3
1 changed files with 6 additions and 4 deletions

View File

@ -158,11 +158,8 @@ def parse(packet):
def _try_toparse_body(packet_type, body, parsed):
result = {}
if packet_type in unsupported_formats:
raise UnknownFormat('format is not supported: {0}'.format(unsupported_formats[packet_type]))
# user defined
elif packet_type == ',':
if packet_type == ',':
logger.debug("Packet is invalid format")
body, result = parse_invalid(body)
@ -203,6 +200,11 @@ def _try_toparse_body(packet_type, body, parsed):
body, result = parse_position(packet_type, body)
# other data types
elif packet_type in unsupported_formats:
raise UnknownFormat('format is not supported: {0}'.format(unsupported_formats[packet_type]))
# we are done
parsed.update(result)