From 40b51e2ac7258a448ff1ba495ff2a6ff95eff7a0 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Tue, 7 May 2019 15:15:38 -0700 Subject: [PATCH] No need to catch error classes whose base classes are already specified --- lib/capybara/selenium/driver.rb | 8 +------- .../selenium/driver_specializations/chrome_driver.rb | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/capybara/selenium/driver.rb b/lib/capybara/selenium/driver.rb index 70d38768e..a1fa05bdb 100644 --- a/lib/capybara/selenium/driver.rb +++ b/lib/capybara/selenium/driver.rb @@ -283,13 +283,7 @@ def clear_browser_state end def clear_browser_state_errors - @clear_browser_state_errors ||= [Selenium::WebDriver::Error::UnknownError].tap do |errors| - unless selenium_4? - ::Selenium::WebDriver.logger.suppress_deprecations do - errors << Selenium::WebDriver::Error::UnhandledError - end - end - end + @clear_browser_state_errors ||= [Selenium::WebDriver::Error::UnknownError] end def unhandled_alert_errors diff --git a/lib/capybara/selenium/driver_specializations/chrome_driver.rb b/lib/capybara/selenium/driver_specializations/chrome_driver.rb index 8131b46b7..a8200432d 100644 --- a/lib/capybara/selenium/driver_specializations/chrome_driver.rb +++ b/lib/capybara/selenium/driver_specializations/chrome_driver.rb @@ -53,13 +53,7 @@ def delete_all_cookies end def cdp_unsupported_errors - @cdp_unsupported_errors ||= [Selenium::WebDriver::Error::WebDriverError].tap do |errors| - unless selenium_4? - ::Selenium::WebDriver.logger.suppress_deprecations do - errors << Selenium::WebDriver::Error::UnhandledError - end - end - end + @cdp_unsupported_errors ||= [Selenium::WebDriver::Error::WebDriverError] end def execute_cdp(cmd, params = {})