Skip to content

Commit

Permalink
修复了召唤师不存在或不在游戏时重复弹窗报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzaphkiel committed Oct 22, 2023
1 parent 2382fae commit d00249b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/view/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from ..common.config import cfg, VERSION
from ..components.update_message_box import UpdateMessageBox
from ..lol.entries import Summoner
from ..lol.exceptions import SummonerGamesNotFound, RetryMaximumAttempts
from ..lol.exceptions import SummonerGamesNotFound, RetryMaximumAttempts, SummonerNotFound, SummonerNotInGame
from ..lol.listener import (LolProcessExistenceListener, LolClientEventListener,
getLolProcessPid)
from ..lol.connector import connector
Expand Down Expand Up @@ -214,8 +214,11 @@ def __onShowLcuConnectError(self, api, obj):
"The server returned abnormal content, which may be under maintenance.")
elif type(obj) is RetryMaximumAttempts:
msg = self.tr("Exceeded maximum retry attempts.")
elif type(obj) in [SummonerNotFound, SummonerNotInGame]:
return
else:
msg = repr(obj)

InfoBar.error(
self.tr("LCU request error"),
self.tr(f"Connect API") + f" {api}: {msg}",
Expand Down

0 comments on commit d00249b

Please sign in to comment.