def on_status(self, status): print ("Adding " + str(status.id)) try: DB.save(status) except Exception as e: print("Exception: " + str(e)); f = open("exception.log", "a"); f.write("Exception: " + str(e) + "\n"); f.close(); except: print("Unknown error") return