Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document error handling #639

Open
dgr opened this issue Aug 20, 2024 · 4 comments
Open

Document error handling #639

dgr opened this issue Aug 20, 2024 · 4 comments

Comments

@dgr
Copy link
Contributor

dgr commented Aug 20, 2024

Problem/Opportunity
Today, most Etaoin API functions document what happens upon success, but they are largely silent about their behavior in error conditions. Do they return nil, another special value, or throw an exception? If they throw an exception, which ones? How do they distinguish between HTTP or TCP/IP exceptions that might happen while interacting with the WebDriver versus WebDriver errors? Are the behaviors for the various supported browsers consistent (is the same response returned or exception thrown for the same condition) or inconsistent?

Proposed Solution
Document the current behavior for error conditions. Where possible, understand differences between different WebDriver implementations.

Action
I can take a first level run at documenting the current behavior. This will probably generate a stream of PRs for doc string and User Guide updates.

@lread
Copy link
Collaborator

lread commented Aug 20, 2024

I think most fns that interact with the WebDriver throw on non-200 responses?
We probably don't want to get too specific about what type of exceptions can be thrown if the source is the WebDriver implementation.

I'm not terribly interested in documenting differences between WebDriver implementations, other than tips in the user guide under troubleshooting. Behaviors of WebDriver implementations are a moving target, and keeping this info fresh could become a full-time job.

@dgr
Copy link
Contributor Author

dgr commented Aug 20, 2024

I think this can be done in a fairly general way that won’t become a maintenance burden. Not every detail needs to be specified but the rough contours should be. And individual functions should specify whether exceptions are thrown for error conditions as opposed to returning error codes or nil.

@lread
Copy link
Collaborator

lread commented Aug 22, 2024

Ok, if you are willing, @dgr! Maybe start with a representative small example of fns in a PR (with supporting user guide docs if applicable). That way, we could review the general approach together before you get too far down the road.

@dgr
Copy link
Contributor Author

dgr commented Aug 22, 2024

Yep, sounds good.

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

No branches or pull requests

2 participants