1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/lib/capybara/webkit/errors.rb
Matthew Horan 8dbf3b8e31 Make FindModal synchronous
* There's no need to poll for the modal when we have an event loop.
2014-07-17 09:39:40 -04:00

44 lines
730 B
Ruby

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 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
end