Class: Capybara::Webkit::JsonError

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/webkit/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ JsonError

Returns a new instance of JsonError.



30
31
32
33
34
35
# File 'lib/capybara/webkit/errors.rb', line 30

def initialize(response)
  error = JSON.parse response

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

Instance Method Details

#exceptionObject



37
38
39
# File 'lib/capybara/webkit/errors.rb', line 37

def exception
  error_class.new @message
end