Exception: Lightpanda::JavaScriptError

Inherits:
Error
  • Object
show all
Defined in:
lib/lightpanda/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ JavaScriptError

Returns a new instance of JavaScriptError.



26
27
28
29
30
31
32
# File 'lib/lightpanda/errors.rb', line 26

def initialize(response)
  @class_name = response.dig("exceptionDetails", "exception", "className")
  @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.



24
25
26
# File 'lib/lightpanda/errors.rb', line 24

def class_name
  @class_name
end

#messageObject (readonly)

Returns the value of attribute message.



24
25
26
# File 'lib/lightpanda/errors.rb', line 24

def message
  @message
end