Skip to content

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

@epicwhale

Description

@epicwhale

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

-

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions