diff --git a/kiss_and_db.py b/kiss_and_db.py index 9d4739f..453fa47 100644 --- a/kiss_and_db.py +++ b/kiss_and_db.py @@ -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()