We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 964f16e commit b8cf408Copy full SHA for b8cf408
src/database/db.py
@@ -91,9 +91,13 @@ def set_chat_lang(chat_id, lang):
91
92
@staticmethod
93
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]
+ try:
+ with TBDB._get_db() as db:
+ 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
101
102
103
def set_chat_voice_enabled(chat_id, voice_enabled):
0 commit comments