Skip to content

Commit

Permalink
No need to catch error classes whose base classes are already specified
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed May 7, 2019
1 parent dad43ca commit 40b51e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions lib/capybara/selenium/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down

0 comments on commit 40b51e2

Please sign in to comment.