2016-02-28 11:11:16 +00:00
|
|
|
"""
|
|
|
|
exception definitions
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
class ParseError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class AprsParseError(ParseError):
|
|
|
|
"""Parse error while parsing an aprs packet."""
|
|
|
|
def __init__(self, aprs_string):
|
|
|
|
self.aprs_string = aprs_string
|
|
|
|
|
2025-04-23 10:20:30 +00:00
|
|
|
self.message = f"This is not a valid APRS packet: {aprs_string}"
|
2016-02-28 11:11:16 +00:00
|
|
|
super(AprsParseError, self).__init__(self.message)
|
|
|
|
|
|
|
|
|
|
|
|
class OgnParseError(ParseError):
|
|
|
|
"""Parse error while parsing an ogn message from aprs comment."""
|
|
|
|
def __init__(self, aprs_comment):
|
|
|
|
self.aprs_comment = aprs_comment
|
|
|
|
|
2025-04-23 10:20:30 +00:00
|
|
|
self.message = f"This is not a valid OGN message: {aprs_comment}"
|
2016-02-28 11:11:16 +00:00
|
|
|
super(OgnParseError, self).__init__(self.message)
|