Exception: Ferrum::BrowserError

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

Overview

Raised when the browser returns an error response over CDP. Wraps the raw response so callers can inspect its code and data.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ BrowserError

Returns a new instance of BrowserError.



131
132
133
134
# File 'lib/ferrum/errors.rb', line 131

def initialize(response)
  @response = response
  super(response["message"])
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



129
130
131
# File 'lib/ferrum/errors.rb', line 129

def response
  @response
end

Instance Method Details

#codeInteger?

Error code from the raw CDP error response.

Returns:

  • (Integer, nil)


141
142
143
# File 'lib/ferrum/errors.rb', line 141

def code
  response["code"]
end

#dataObject?

Additional data from the raw CDP error response.

Returns:

  • (Object, nil)


150
151
152
# File 'lib/ferrum/errors.rb', line 150

def data
  response["data"]
end