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).
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:When a proxy rejects the tunnel, the proxy's HTTP status code should be available on the error (e.g. statusCode: 403).