🎨 Add get icon exception handling

This commit is contained in:
洛水居室 2022-11-23 23:02:34 +08:00
parent 2de87788b1
commit 57006259f1
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -38,6 +38,9 @@ class Inline(Plugin):
icon = await self.assets_service.weapon(weapons_name).get_link("icon")
except AssetsCouldNotFound:
continue
except Exception as exc:
logger.error("获取武器信息失败 %s", str(exc))
continue
data = {"name": weapons_name, "icon": icon}
self.weapons_list.append(data)
logger.success("Inline 模块获取武器列表成功")
@ -50,6 +53,9 @@ class Inline(Plugin):
icon = await self.assets_service.avatar(character_name).get_link("icon")
except AssetsCouldNotFound:
continue
except Exception as exc:
logger.error("获取角色信息失败 %s", str(exc))
continue
data = {"name": character_name, "icon": icon}
self.characters_list.append(data)
logger.success("Inline 模块获取角色列表成功")