You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an Amp\Http\Client\SocketException exception that covers different types of connection errors. However, I found out that it's not possible to distinguish between them programmatically, they are all the same except for the error message.
I need to differentiate a specific error, and the only way to do that is to check if the error message contains a substring, which is not reliable.
What do you think we can do about this? My first thought is to add unique exception codes to all SocketException cases.
The text was updated successfully, but these errors were encountered:
I agree with the problem. In my case I get an exception with the text Receiving the response headers for ‘http://localhost:8080/’ failed, because the socket to ‘localhost:8080’ @ ‘???’ closed early with 0 bytes received within 10.001 seconds
My request has a timeout of 10 seconds $httpClient->request('GET', 'http://localhost:8080', ['timeout' => 10, 'http_errors' => true]) , but the exception I encounter is SocketException instead of the expected TimeoutException.
There is an Amp\Http\Client\SocketException exception that covers different types of connection errors. However, I found out that it's not possible to distinguish between them programmatically, they are all the same except for the error message.
I need to differentiate a specific error, and the only way to do that is to check if the error message contains a substring, which is not reliable.
What do you think we can do about this? My first thought is to add unique exception codes to all SocketException cases.
The text was updated successfully, but these errors were encountered: