Closed vdusek closed 3 months ago
currently, curl-cffi only has one general error for all curl errors. Adding support for mapping curl errors into Python errors would be a nice addition.
For now, the way of detecting certain errors is by using the curl error code. However for this particular error, curl does not appear to distinguish the proxy error by a code so you have to do a string match in addition to code check.
An example from our project: https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp%2Fnetworking%2F_curlcffi.py#L241
Progress is tracked in #250.
Describe the bug
RequestsError
exception with "CONNECT tunnel failed, response 400".To Reproduce
Resulting in:
Expected behavior
Example in HTTPX:
Results in:
Versions
curl_cffi
version: 0.7.1proxy.py
version: 2.4.4httpx
version: 0.27.0