mirror of
https://github.com/User0332/rewards-farmer.git
synced 2026-09-16 01:31:36 +00:00
merge upstream: NoSuchWindowException when closing a tab
Upstream widened the except in close_all_tabs_except to catch NoSuchWindowException; this branch had rewritten the same two lines from print to logging. Both are wanted, so the resolution keeps the wider except and the logger call, and takes the new import. Claude-Session: https://claude.ai/code/session_01RCncv1HC4UvoJcYqBtwxrt
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
from selenium.common.exceptions import WebDriverException, JavascriptException
|
from selenium.common.exceptions import WebDriverException, JavascriptException, NoSuchWindowException
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -63,7 +63,7 @@ document.dispatchEvent(new Event('visibilitychange'));
|
|||||||
# not close is a real problem.
|
# not close is a real problem.
|
||||||
logger.debug("Closed tab with handle %s and URL %s.", handle, tab_url)
|
logger.debug("Closed tab with handle %s and URL %s.", handle, tab_url)
|
||||||
|
|
||||||
except WebDriverException:
|
except (WebDriverException, NoSuchWindowException):
|
||||||
logger.warning("Could not close tab with handle %s and URL %s.", handle, tab_url)
|
logger.warning("Could not close tab with handle %s and URL %s.", handle, tab_url)
|
||||||
self.problematic_tabs.add(handle)
|
self.problematic_tabs.add(handle)
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user