Skip to content

Commit 84d6747

Browse files
committed
Canceled request handling proof of concept
This adds a symbol as a placeholder error for a canceled request, pending deciding how is it best to handle it.
1 parent caea758 commit 84d6747

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/ferrum/network.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ def subscribe
157157
end
158158
end
159159

160+
@page.on("Network.loadingFailed") do |params|
161+
exchange = select(params["requestId"]).last
162+
163+
if exchange && params['canceled']
164+
exchange.error = :canceled
165+
end
166+
end
167+
160168
@page.on("Log.entryAdded") do |params|
161169
entry = params["entry"] || {}
162170
if entry["source"] == "network" && entry["level"] == "error"

0 commit comments

Comments
 (0)