Skip to content

Commit b8cf408

Browse files
log chat_id for TypeError in get_chat_voice_enabled
1 parent 964f16e commit b8cf408

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/database/db.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,13 @@ def set_chat_lang(chat_id, lang):
9191

9292
@staticmethod
9393
def get_chat_voice_enabled(chat_id):
94-
with TBDB._get_db() as db:
95-
c = db.execute("SELECT voice_enabled FROM chats WHERE chat_id='{0}'".format(chat_id))
96-
return c.fetchone()[0]
94+
try:
95+
with TBDB._get_db() as db:
96+
c = db.execute("SELECT voice_enabled FROM chats WHERE chat_id='{0}'".format(chat_id))
97+
return c.fetchone()[0]
98+
except TypeError as e:
99+
logger.error("Error getting voice_enabled for chat %d: %s", chat_id, e)
100+
raise e
97101

98102
@staticmethod
99103
def set_chat_voice_enabled(chat_id, voice_enabled):

0 commit comments

Comments
 (0)