Skip to content

Commit 40b51e2

Browse files
committed
No need to catch error classes whose base classes are already specified
1 parent dad43ca commit 40b51e2

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

lib/capybara/selenium/driver.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,7 @@ def clear_browser_state
283283
end
284284

285285
def clear_browser_state_errors
286-
@clear_browser_state_errors ||= [Selenium::WebDriver::Error::UnknownError].tap do |errors|
287-
unless selenium_4?
288-
::Selenium::WebDriver.logger.suppress_deprecations do
289-
errors << Selenium::WebDriver::Error::UnhandledError
290-
end
291-
end
292-
end
286+
@clear_browser_state_errors ||= [Selenium::WebDriver::Error::UnknownError]
293287
end
294288

295289
def unhandled_alert_errors

lib/capybara/selenium/driver_specializations/chrome_driver.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,7 @@ def delete_all_cookies
5353
end
5454

5555
def cdp_unsupported_errors
56-
@cdp_unsupported_errors ||= [Selenium::WebDriver::Error::WebDriverError].tap do |errors|
57-
unless selenium_4?
58-
::Selenium::WebDriver.logger.suppress_deprecations do
59-
errors << Selenium::WebDriver::Error::UnhandledError
60-
end
61-
end
62-
end
56+
@cdp_unsupported_errors ||= [Selenium::WebDriver::Error::WebDriverError]
6357
end
6458

6559
def execute_cdp(cmd, params = {})

0 commit comments

Comments
 (0)