From 619b282fd893a4db01853331f2bd6de6d3d985e5 Mon Sep 17 00:00:00 2001 From: Carl Furtado Date: Sun, 30 Aug 2026 11:44:04 -0400 Subject: [PATCH] catch NoSuchWindowException in tab_utils --- src/tab_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tab_utils.py b/src/tab_utils.py index a72012d..c936905 100644 --- a/src/tab_utils.py +++ b/src/tab_utils.py @@ -1,4 +1,4 @@ -from selenium.common.exceptions import WebDriverException, JavascriptException +from selenium.common.exceptions import WebDriverException, JavascriptException, NoSuchWindowException from selenium import webdriver GHOST_TAB_URLS = ( @@ -56,7 +56,7 @@ document.dispatchEvent(new Event('visibilitychange')); self.driver.close() print(f"[INFO] Closed tab with handle {handle} and URL {tab_url}.") - except WebDriverException: + except (WebDriverException, NoSuchWindowException): print(f"[WARNING] Could not close tab with handle {handle} and URL {tab_url}.") self.problematic_tabs.add(handle) pass