guzzle icon indicating copy to clipboard operation
guzzle copied to clipboard

Different timeout exceptions

Open strictboss opened this issue 4 years ago • 5 comments

Dear developers, can you please add possability to make a difference between two cases:

  • connect_timeout exceeds;
  • timeout exceeds.

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!

strictboss avatar Sep 22 '21 13:09 strictboss

Please, make many exceptions classes to distinguish errors easily.

I'd happily review a PR to do this in a non-breaking way. :)

GrahamCampbell avatar Oct 18 '21 00:10 GrahamCampbell

@GrahamCampbell do you have some thoughts / pointers on that?

sandervanhooft avatar Dec 02 '21 11:12 sandervanhooft

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.

stale[bot] avatar Apr 02 '22 08:04 stale[bot]

Not stale

sandervanhooft avatar Apr 02 '22 10:04 sandervanhooft

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.

stale[bot] avatar Aug 10 '22 06:08 stale[bot]

not stale

hyfox avatar Aug 30 '22 15:08 hyfox

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.

GrahamCampbell avatar Aug 30 '22 21:08 GrahamCampbell