Handle update_info errors inside entity instead of in user

This commit is contained in:
Tulir Asokan
2019-08-13 14:44:24 +03:00
parent 1ac1bf5b60
commit 2a327cc29e
2 changed files with 20 additions and 14 deletions
+6 -3
View File
@@ -234,9 +234,12 @@ class Puppet(CustomPuppetMixin):
self.username = info.username
changed = True
changed = await self.update_displayname(source, info) or changed
if isinstance(info.photo, UserProfilePhoto):
changed = await self.update_avatar(source, info.photo) or changed
try:
changed = await self.update_displayname(source, info) or changed
if isinstance(info.photo, UserProfilePhoto):
changed = await self.update_avatar(source, info.photo) or changed
except Exception:
self.log.exception(f"Failed to update info from source {source.tgid}")
self.is_bot = info.bot