Class: WebkitRemote::Event::NetworkFailure
- Inherits:
-
WebkitRemote::Event
- Object
- WebkitRemote::Event
- WebkitRemote::Event::NetworkFailure
- Defined in:
- lib/webkit_remote/client/network_events.rb
Overview
Emitted when a resource fails to load.
Instance Attribute Summary collapse
-
#canceled ⇒ Boolean
readonly
For example, CORS violations cause requests to be canceled.
-
#error ⇒ String
readonly
The error message.
-
#resource ⇒ WebkitRemote::Client::NetworkResource
readonly
Information about the resource fetched by this network operation.
-
#timestamp ⇒ Number
readonly
The event timestamp.
Attributes inherited from WebkitRemote::Event
Instance Method Summary collapse
-
#initialize(rpc_event, client) ⇒ NetworkFailure
constructor
A new instance of NetworkFailure.
Methods inherited from WebkitRemote::Event
can_reach?, can_receive?, class_for, for, #matches?, register, register_class
Constructor Details
#initialize(rpc_event, client) ⇒ NetworkFailure
Returns a new instance of NetworkFailure.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/webkit_remote/client/network_events.rb', line 56 def initialize(rpc_event, client) super @canceled = !!raw_data['canceled'] @error = raw_data['errorText'] @timestamp = raw_data['timestamp'] @resource = client.network_resource raw_data['requestId'] @resource.set_canceled @canceled @resource.set_error @error @resource.add_event self end |
Instance Attribute Details
#canceled ⇒ Boolean (readonly)
For example, CORS violations cause requests to be canceled.
53 54 55 |
# File 'lib/webkit_remote/client/network_events.rb', line 53 def canceled @canceled end |
#error ⇒ String (readonly)
Returns the error message.
48 49 50 |
# File 'lib/webkit_remote/client/network_events.rb', line 48 def error @error end |
#resource ⇒ WebkitRemote::Client::NetworkResource (readonly)
Returns information about the resource fetched by this network operation.
42 43 44 |
# File 'lib/webkit_remote/client/network_events.rb', line 42 def resource @resource end |
#timestamp ⇒ Number (readonly)
Returns the event timestamp.
45 46 47 |
# File 'lib/webkit_remote/client/network_events.rb', line 45 def @timestamp end |