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
{{ message }}
This repository was archived by the owner on Jan 6, 2024. It is now read-only.
When chaining a promise and throwing an exception, the exception is wrapped inside an Exception with the message Invalid exception returned from Guzzle6.
... results in a RuntimeException with the message Invalid exception returned from Guzzle6 (with my Exception as previous).
Possible Solutions
The exception wrapping only makes sense when the actual request is being made (anything beyond that is not Guzzle). Either then return a different promise type in Promise::then()
Actual Behavior
When chaining a promise and throwing an exception, the exception is wrapped inside an
Exceptionwith the messageInvalid exception returned from Guzzle6.Expected Behavior
That my exception is thrown directly.
Steps to Reproduce
... results in a
RuntimeExceptionwith the messageInvalid exception returned from Guzzle6(with myExceptionasprevious).Possible Solutions
The exception wrapping only makes sense when the actual request is being made (anything beyond that is not Guzzle). Either then return a different promise type in
Promise::then()guzzle6-adapter/src/Promise.php
Line 79 in a56941f
guzzle6-adapter/src/Promise.php
Lines 64 to 68 in a56941f
(Related, this will also hide any fatal errors (eg
TypeError) behind the meaningless 'Reason returned from Guzzle6 must be an Exception' exception.)