mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Handle sqlite3.OperationalError in update loop
This commit is contained in:
parent
a0cda0c37c
commit
4eef9b52c9
|
@ -9,6 +9,7 @@ import typing
|
||||||
import logging
|
import logging
|
||||||
import warnings
|
import warnings
|
||||||
from collections import deque
|
from collections import deque
|
||||||
|
import sqlite3
|
||||||
|
|
||||||
from .. import events, utils, errors
|
from .. import events, utils, errors
|
||||||
from ..events.common import EventBuilder, EventCommon
|
from ..events.common import EventBuilder, EventCommon
|
||||||
|
@ -319,7 +320,7 @@ class UpdateMethods:
|
||||||
await self.disconnect()
|
await self.disconnect()
|
||||||
break
|
break
|
||||||
continue
|
continue
|
||||||
except errors.TypeNotFoundError as e:
|
except (errors.TypeNotFoundError, sqlite3.OperationalError) as e:
|
||||||
# User is likely doing weird things with their account or session and Telegram gets confused as to what layer they use
|
# User is likely doing weird things with their account or session and Telegram gets confused as to what layer they use
|
||||||
self._log[__name__].warning('Cannot get difference since the account is likely misusing the session: %s', e)
|
self._log[__name__].warning('Cannot get difference since the account is likely misusing the session: %s', e)
|
||||||
self._message_box.end_difference()
|
self._message_box.end_difference()
|
||||||
|
@ -361,7 +362,7 @@ class UpdateMethods:
|
||||||
await self.disconnect()
|
await self.disconnect()
|
||||||
break
|
break
|
||||||
continue
|
continue
|
||||||
except errors.TypeNotFoundError as e:
|
except (errors.TypeNotFoundError, sqlite3.OperationalError) as e:
|
||||||
self._log[__name__].warning(
|
self._log[__name__].warning(
|
||||||
'Cannot get difference for channel %s since the account is likely misusing the session: %s',
|
'Cannot get difference for channel %s since the account is likely misusing the session: %s',
|
||||||
get_diff.channel.channel_id, e
|
get_diff.channel.channel_id, e
|
||||||
|
|
Loading…
Reference in New Issue
Block a user