Skip to content

Create dedicated type for HTTP CONNECT errors and pass status code #397

@danpoletaev

Description

@danpoletaev

Currently, all request failures (connection refused, proxy rejections, HTTP errors, etc.) surface as a generic error(GenericFailure). There's no way for callers to tell why the request failed.

What we want:
Introduce a dedicated type(e.g. ImpitConnectError) that is thrown when the connection phase fails - i.e. before any response from the target server was received. This covers:

  • TCP connection refused
  • Connect timeout
  • HTTP proxy rejecting the CONNECT tunnel (e.g. proxy returns 403 or 407)

When a proxy rejects the tunnel, the proxy's HTTP status code should be available on the error (e.g. statusCode: 403).

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions