Keep exception message when re-raising the correct type

This commit is contained in:
Thomas Walpole 2019-04-22 12:03:02 -07:00
parent 21b8b4d5fb
commit d859e50f47
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ class Capybara::Selenium::ChromeNode < Capybara::Selenium::Node
super
rescue ::Selenium::WebDriver::Error::WebDriverError => e
# chromedriver 74 (at least on mac) raises the wrong error for this
raise ::Selenium::WebDriver::Error::ElementClickInterceptedError if e.message.match?(/element click intercepted/)
raise ::Selenium::WebDriver::Error::ElementClickInterceptedError, e.message if e.message.match?(/element click intercepted/)
raise
end