Sha256: 13e927394ef3385e730fe5d69cb824e2afd6e74ce64430f467f6b72ff551638d

Contents?: true

Size: 804 Bytes

Versions: 12

Compression:

Stored size: 804 Bytes

Contents

module Selenium
  module WebDriver
    module Error
      class ServerError < StandardError

        def initialize(response)
          return super(response) if response.kind_of?(String)

          if response.error
            super(response.error["message"])
          else
            super("status code #{response.code}")
          end
        end

      end

      REMOTE_EXCEPTIONS = {
        'org.openqa.selenium.NoSuchElementException' => NoSuchElementError,
        'org.openqa.selenium.NoSuchFrameException'   => NoSuchFrameError,
        'org.openqa.selenium.NoSuchWindowException'  => NoSuchWindowError,
      }

      class << self
        def for_remote_class(klass)
          REMOTE_EXCEPTIONS[klass] || ServerError
        end
      end

    end # Error
  end # WebDriver
end # Selenium

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
selenium-webdriver-0.0.12 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.11 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.10 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.9 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.8 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.7 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.6 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.5 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.4 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.3 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.2 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb
selenium-webdriver-0.0.1 remote/client/src/rb/lib/selenium/webdriver/remote/server_error.rb