-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible TypeError when type hinting the Pool rejected callable with a RequestException #3011
Comments
Using TransferException will throw [GuzzleHttp\Exception\RequestException], how to solve it? |
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. |
I have this issue too using latest laravel 9, I tried the TransferException fix but for me is not working, I always got GuzzleHttp\Exception\ConnectException given. Any fix for this? |
7.5 is affected too. |
Any solution for this ? |
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. |
This is just a documentation issue. If you are unsure of the correct type to use, you could just put Throwable there. |
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. |
Have same issue ##TypeError
|
Guzzle version(s) affected: 7.4.2
Description
The documentation for using a
GuzzleHttp\Pool
suggests type hinting therejected
callable with a\GuzzleHttp\Exception\RequestException
https://docs.guzzlephp.org/en/stable/quickstart.html#concurrent-requests
This can lead to a
TypeError
since it is possible to receive a\GuzzleHttp\Exception\ConnectException
at this point as well.How to reproduce
This results in the following error:
Possible Solution
Changing
RequestException
toTransferException
would prevent theTypeError
:(since both
RequestException
andConnectException
extend theTransferException
)Can the example in the documentation be updated to prevent a
TypeError
from happening?Additional context
The text was updated successfully, but these errors were encountered: