guzzle
guzzle copied to clipboard
Different timeout exceptions
Dear developers, can you please add possability to make a difference between two cases:
connect_timeoutexceeds;timeoutexceeds.
It is really need to distinguish these two cases, because if connect_timeout exceed - request was not send (TCP connection was not establish during certain time), but if timeout exceeded - request was actually send and i have just did not wait for all response! And in both cases i get the same exception (GuzzleHttp\Exception\ConnectException) with the same exception instance code (0) with the same message of error. This is really important thing and there is a very big difference between these two cases.
Please, make many exceptions classes to distinguish errors easily.
Another variant is to proxy code of error from cURL to code of exception. On cURL docs all errors described with its code (https://curl.se/docs/manpage.html). The main thing, i think, is possability to make difference: whether the request reached the server or not.
Unfortunatelly, now we have nothing to do except parse message of exception 😓
Thank you!
Please, make many exceptions classes to distinguish errors easily.
I'd happily review a PR to do this in a non-breaking way. :)
@GrahamCampbell do you have some thoughts / pointers on that?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you for your contributions.
Not stale
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you for your contributions.
not stale
The main thing, i think, is possability to make difference: whether the request reached the server or not.
We still don't know that, anyway. Even if connect works, we may only send the front of the request. I don't plan to complete the work here from this issue, so I'm going to close it. Someone is still welcome to try this, but I don't think as scoped this meets the requirements you needed this for anyway, so would be wasted work.