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.



48
49
50
51
52
53
54
# File 'lib/capybara/lightpanda/errors.rb', line 48

def initialize(response)
  @class_name = response.dig("exceptionDetails", "exception", "className")
  @stack_trace = response.dig("exceptionDetails", "stackTrace")
  message = response.dig("exceptionDetails", "exception", "description") ||
            response.dig("exceptionDetails", "text")
  super(message)
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



46
47
48
# File 'lib/capybara/lightpanda/errors.rb', line 46

def class_name
  @class_name
end

#stack_traceObject (readonly)

Returns the value of attribute stack_trace.



46
47
48
# File 'lib/capybara/lightpanda/errors.rb', line 46

def stack_trace
  @stack_trace
end