123456789_123456789_123456789_123456789_123456789_

Module: Selenium::WebDriver::Error

Constant Summary

Class Method Summary

Class Method Details

.for_error(error)

Returns exception from its string representation.

Parameters:

  • error (String, nil)
[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/error.rb', line 28

def self.for_error(error)
  return if error.nil?

  klass_name = error.split.map(&:capitalize).join.sub(/Error$/, '')
  const_get(:"#{klass_name}Error", false)
rescue NameError
  WebDriverError
end