Exception: Capybara::Apparition::JavascriptError
- Inherits:
-
ClientError
- Object
- StandardError
- Error
- ClientError
- Capybara::Apparition::JavascriptError
- Defined in:
- lib/capybara/apparition/errors.rb
Instance Attribute Summary
Attributes inherited from ClientError
Instance Method Summary collapse
-
#javascript_errors ⇒ Object
def javascript_errors response.first.map { |data| JSErrorItem.new(data, data) } end.
- #message ⇒ Object
Methods inherited from ClientError
Constructor Details
This class inherits a constructor from Capybara::Apparition::ClientError
Instance Method Details
#javascript_errors ⇒ Object
def javascript_errors
response['args'].first.map { |data| JSErrorItem.new(data['message'], data['stack']) }
end
59 60 61 |
# File 'lib/capybara/apparition/errors.rb', line 59 def javascript_errors [message: response] end |
#message ⇒ Object
63 64 65 66 67 68 69 |
# File 'lib/capybara/apparition/errors.rb', line 63 def 'One or more errors were raised in the Javascript code on the page. ' \ "If you don't care about these errors, you can ignore them by " \ 'setting js_errors: false in your Apparition configuration (see ' \ 'documentation for details).' \ "\n\n#{javascript_errors.map { |err| err[:message] }.join("\n")}" end |