exception handle

This commit is contained in:
2025-02-07 10:22:43 +08:00
parent e4351b2d4a
commit 64ee2ba2f5

View File

@@ -333,11 +333,18 @@ class Robot(Job):
def messageCountToDB(self): def messageCountToDB(self):
write_to_db() try:
write_to_db()
except Exception as e:
self.LOG.error(f"write_to_db error{e}")
def generateAndSendRanking(self): def generateAndSendRanking(self):
receivers = self.config.NEWS try:
if not receivers: receivers = self.config.NEWS
return if not receivers:
for r in receivers: return
self.sendTextMsg(generate_and_send_ranking(r,self.allContacts), r) for r in receivers:
self.sendTextMsg(generate_and_send_ranking(r, self.allContacts), r)
except Exception as e:
self.LOG.error(f"SendRanking error{e}")