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

[Bug]: Error: net::ERR_PROXY_CONNECTION_FAILED .... is of type playwright._impl._errors.Error #2425

Closed
epicwhale opened this issue Apr 27, 2024 · 1 comment

Comments

@epicwhale
Copy link

Version

1.43.0

Steps to reproduce

Example steps (replace with your own):

  1. Create a new_page using a proxy_config server url that will fail:
page = await browser.new_page(
        proxy={},  # configure with a failing server
    )
await page.goto(...)

Expected behavior

Raise an exception type that can be handled in an except block similar to TimeoutError

Actual behavior

Raises a generic exception of type:
playwright._impl._errors.Error
Error('net::ERR_PROXY_CONNECTION_FAILED at http://...')

Additional context

The Error type raised and the object format would require me to string match for "net::ERR_PROXY_CONNECTION_FAILED" in the message string.

Is there a more elegant way to do this? Maybe I am missing something but could not find anything on Google or Github about this.

Environment

-
@mxschmitt mxschmitt transferred this issue from microsoft/playwright-python May 1, 2024
@dgozman dgozman transferred this issue from microsoft/playwright May 1, 2024
@mxschmitt
Copy link
Member

Browsers have individual error messages, creating different kind of error classes is outside of the scope for Playwright. (we'd need to create hundreds for each browser)

We recommend matching them via a str as you proposed as a workaround.

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