Try to catch exceptions.
This commit is contained in:
parent
e7002c712c
commit
50085de7db
|
@ -66,15 +66,18 @@ def main():
|
|||
try:
|
||||
try:
|
||||
a = aprslib.parse(str(frame))
|
||||
except:
|
||||
logging.error("Error with aprslib!")
|
||||
except Exception as error:
|
||||
logging.error("Error with aprslib:", error)
|
||||
a['station_call'] = config['Settings']['station_call']
|
||||
a['station_lat'] = config['Settings']['station_lat']
|
||||
a['station_lon'] = config['Settings']['station_lon']
|
||||
a['created_unix'] = int(time.time())
|
||||
print(a)
|
||||
|
||||
# Make this a string and deal with it later (probably a mistake)
|
||||
a['path'] = str(a['path'])
|
||||
if 'subpacket' in a:
|
||||
a['subpacket'] = str(a['subpacket'])
|
||||
#logging.debug(a['path'])
|
||||
# Store true/false as 1/0
|
||||
if 'alive' in a:
|
||||
if a['alive'] == True:
|
||||
|
@ -121,9 +124,9 @@ def main():
|
|||
except:
|
||||
#print("Error with SQLite!")
|
||||
logging.error("Error with SQLite!")
|
||||
except:
|
||||
except Exception as error:
|
||||
#print("Frame could not be parsed.")
|
||||
logging.error("Frame could not be parsed.")
|
||||
logging.error("Frame could not be parsed:", error)
|
||||
|
||||
|
||||
conn.close()
|
||||
|
|
Loading…
Reference in New Issue
Block a user