Sha256: 6b33062ea4285dadb21269d50fcf1f38f1e5488fa11ee8674243a9f558a73979

Contents?: true

Size: 954 Bytes

Versions: 4

Compression:

Stored size: 954 Bytes

Contents

module Capybara::Webkit
  class InvalidResponseError < StandardError
  end

  class NoResponseError < StandardError
  end

  class NodeNotAttachedError < Capybara::ElementNotFound
  end

  class ClickFailed < StandardError
  end

  class TimeoutError < Timeout::Error
  end

  class NoSuchWindowError < StandardError
  end

  class ConnectionError < StandardError
  end

  class ModalNotFound < StandardError
  end

  class CrashError < StandardError
  end

  class JsonError
    def initialize(response)
      error = JSON.parse response

      @class_name = error['class']
      @message = error['message']
    end

    def exception
      error_class.new @message
    end

    private

    def error_class
      Capybara::Webkit.const_get @class_name
    end
  end

  class JavaScriptError < StandardError
    def initialize(errors)
      @javascript_errors = errors
      super(errors.join(","))
    end

    attr_reader :javascript_errors
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
capybara-webkit-1.15.1 lib/capybara/webkit/errors.rb
capybara-webkit-1.15.0 lib/capybara/webkit/errors.rb
capybara-webkit-1.14.0 lib/capybara/webkit/errors.rb
capybara-webkit-1.13.0 lib/capybara/webkit/errors.rb