exception handle
This commit is contained in:
19
robot.py
19
robot.py
@@ -333,11 +333,18 @@ class Robot(Job):
|
||||
|
||||
|
||||
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):
|
||||
receivers = self.config.NEWS
|
||||
if not receivers:
|
||||
return
|
||||
for r in receivers:
|
||||
self.sendTextMsg(generate_and_send_ranking(r,self.allContacts), r)
|
||||
try:
|
||||
receivers = self.config.NEWS
|
||||
if not receivers:
|
||||
return
|
||||
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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user