Repository navigation
ref(errors)!: raise ArgumentError for bad arguments and fix misleading error messages - #729
Merged
Merged
Conversation
…g error messages Bare RuntimeError raises (unknown mouse button, cookies.remove without :domain or :url, relative go_to without :base_url) become ArgumentError, a relative :save_path raises ArgumentError instead of Ferrum::Error, and screencast and debug_url failures raise Ferrum::Error. NoSuchPageError, NoSuchTargetError, EmptyPathError, CoordinatesNotFoundError and ArgumentErrors without text now name what's missing or list the valid values. DeadBrowserError no longer talks about windows, NodeMovingError no longer assumes a click, TimeoutError is one line, raw array inspects become a | b lists, and links point to docs.rubycdp.com. Refs #557
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #557, "Update error messages".
Error classes (breaking)
ArgumentErrorinstead ofRuntimeError: an unknown mouse button,cookies.removewithout:domainor:url, a relativego_towithout:base_url.ArgumentErrorinstead ofFerrum::Error: a relative:save_path.Ferrum::Errorinstead ofRuntimeError: a failed screencast,debug_urlwhen the browser lists no page.Browser::Options::BASE_URL_SCHEMAis renamed toBASE_URL_SCHEMES.Messages
NoSuchPageErrornames the command and the target id,attach_target'sNoSuchTargetErrornames the target and the context.CoordinatesNotFoundErrorkeeps Chrome's text,EmptyPathErrorgets a default message.ArgumentErrors that had no text (frame.state=,downloads.set_behavior) list the valid values, the keyboard's "unexpected argument" says what was passed.DeadBrowserErrorno longer mentions windows,NodeMovingErrorno longer assumes a click,TimeoutErroris one line.:a | :blists,RGBAand:background_colormessages read as sentences, the PDF:formatmessage says the options exclude each other.Messages that were already clear keep their text, some are only capitalized.