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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user