Skip to content

feat(errors): name the command a timeout was waiting on - #631

Merged
route merged 2 commits into
mainfrom
fix/timeout-error-names-the-command
Sep 3, 2026
Merged

feat(errors): name the command a timeout was waiting on#631
route merged 2 commits into
mainfrom
fix/timeout-error-names-the-command

Conversation

@route

@route route commented Sep 2, 2026

Copy link
Copy Markdown
Member

Refs #470.

The problem

Ferrum::TimeoutError said only that a response never came:

Timed out waiting for response. It's possible that this happened because something took a very long time...

Which command, on which session, isn't in there. #470 is the cost of that: it took a year, three reporters and a full FERRUM_DEBUG transcript to establish that the command left unanswered was Page.enable on a freshly created page.

The change

The command and the session are part of the message, and readable off the error:

Timed out waiting for a response to Page.enable (session 93FF304962AB15CD3FF17CEF057BB1B8). It's possible that...
rescue Ferrum::TimeoutError => e
  e.command     # "Page.enable"
  e.session_id  # "93FF304962AB15CD3FF17CEF057BB1B8"
end

Only Client#send_message passes them, since it's the only place that waits on a specific command. The waits that aren't for one, Network#wait_for_idle and Page#command's post-command event wait, raise the same message as before, and a browser-session command gets a response to Target.createTarget with no session part.

Verification

  • New example in spec/client_spec.rb: a Page.navigate to the app's slow route with a short timeout raises with a response to Page.navigate (session ...).
  • Full suite: 616 examples, 0 failures.

`Ferrum::TimeoutError` said only that something timed out, so a report of one carried no hint of which command, on
which session, was left unanswered. Diagnosing #470 needed full `FERRUM_DEBUG` logs from three reporters to find out
it was `Page.enable`.

The command and session are now part of the message and exposed as `#command`/`#session_id`. Waits that aren't for a
command, network idle for instance, keep the message they had.

Refs #470
…es-the-command

# Conflicts:
#	spec/client_spec.rb
@route
route merged commit 1dd5f2e into main Sep 3, 2026
7 checks passed
@route
route deleted the fix/timeout-error-names-the-command branch September 3, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant