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
+3 -8
View File
@@ -45,9 +45,8 @@ class CheckinResultDialog(Dialog):
self._waitPresence(self.RESULT_MSG)
el = self._find(*self.RESULT_MSG)
return el.text
except (TimeoutException, NoSuchElementException, StaleElementReferenceException):
return ""
except Exception:
except (TimeoutException, NoSuchElementException,
StaleElementReferenceException):
return ""
def getDetails(
@@ -59,8 +58,6 @@ class CheckinResultDialog(Dialog):
return [el.text for el in elements if el.text.strip()]
except (NoSuchElementException, StaleElementReferenceException):
return []
except Exception:
return []
def clickOk(
self,
@@ -69,7 +66,5 @@ class CheckinResultDialog(Dialog):
try:
self._waitClickable(self.OK_BTN).click()
return True
except (NoSuchElementException, TimeoutException, ElementNotInteractableException):
return False
except Exception:
except (TimeoutException, ElementNotInteractableException):
return False