1
1
mirror of https://github.com/KenanZhu/AutoLibrary.git synced 2026-06-18 07:23:03 +08:00

fix(pages): 移除裸 except Exception 改用精确异常类型并加固元素操作防护

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-28 01:36:18 +08:00
parent 910e3e3224
commit df7ad92f7f
13 changed files with 156 additions and 195 deletions
+2 -4
View File
@@ -10,6 +10,7 @@ See the LICENSE file for details.
import queue
from selenium.common.exceptions import (
ElementNotInteractableException,
NoSuchElementException,
TimeoutException,
)
@@ -83,9 +84,6 @@ class CheckinFlow(MsgBase):
dialog.clickOk()
self._showTrace(f"用户 {username} 签到失败 !", self.TraceLevel.ERROR)
return False
except (NoSuchElementException, TimeoutException):
self._showTrace("签到时发生未知错误 !", self.TraceLevel.ERROR)
return False
except Exception:
except (TimeoutException, NoSuchElementException, ElementNotInteractableException):
self._showTrace("签到时发生未知错误 !", self.TraceLevel.ERROR)
return False