rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.7k stars 122 forks source link

Raise `Ferrum::StatusError` for any top frame navigation error #341

Closed francisbeaudoin closed 1 year ago

francisbeaudoin commented 1 year ago

Context

The Page#go_to is only raising a Ferrum::StatusError for a subset of exceptions:

https://github.com/rubycdp/ferrum/blob/0cab51d1f0500efa7573cac39f99c44421f81c86/lib/ferrum/page.rb#L113-L124

Per the Chrome DevTools documentation an errorText is present if and only if navigation has failed.

Proposal

This PR is proposing to raise regardless of the errorText given that the navigation failed.

Warning This could be considered as a breaking change.

Reference

Discussion: https://github.com/rubycdp/ferrum/discussions/340

route commented 1 year ago

Thank you! Awesome!