Exception: Capybara::Lightpanda::JavaScriptError

Inherits:
BrowserError show all
Defined in:
lib/capybara/lightpanda/errors.rb

Instance Attribute Summary collapse

Attributes inherited from BrowserError

#response

Instance Method Summary collapse

Methods inherited from BrowserError

#code, #data

Constructor Details

#initialize(response) ⇒ JavaScriptError

Returns a new instance of JavaScriptError.



56
57
58
59
60
61
62
# File 'lib/capybara/lightpanda/errors.rb', line 56

def initialize(response)
  details = response["exceptionDetails"] || {}
  exception = details["exception"] || {}
  @class_name = exception["className"]
  @stack_trace = details["stackTrace"]
  super(build_message(details, exception))
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



54
55
56
# File 'lib/capybara/lightpanda/errors.rb', line 54

def class_name
  @class_name
end

#stack_traceObject (readonly)

Returns the value of attribute stack_trace.



54
55
56
# File 'lib/capybara/lightpanda/errors.rb', line 54

def stack_trace
  @stack_trace
end