module Selenium::WebDriver::Error
def self.for_error(error)
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