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 has been archived by the owner on Jul 15, 2021. It is now read-only.
It seems like a rejection reason does not necessarily need to be an exception because the reason is never typehinted in guzzle/promises. In this case the bug is more in Guzzle itself that the log middleware cannot deal with that.
The text was updated successfully, but these errors were encountered:
Tobion
added a commit
to Tobion/guzzle-cache-middleware
that referenced
this issue
Jan 15, 2018
What we can do there is simply change the reason to be an instance of an Exception type, which could then be handled by the log handler. I'm not sure, but this may need some changes in the data collector, as I am not entirely certain about how Guzzle actually handles errors (as you mentioned, because of the missing type hint, it is a bit of a grey area).
The MockMiddleware creates a RejectedPromise with a string reason in https://github.com/csarrazi/guzzle-cache-middleware/blob/master/src/MockMiddleware.php#L47 if the cache is not found. The log middleware then fails because the MessageFormatter requires an exception in https://github.com/guzzle/guzzle/blob/master/src/MessageFormatter.php#L70
It seems like a rejection reason does not necessarily need to be an exception because the reason is never typehinted in guzzle/promises. In this case the bug is more in Guzzle itself that the log middleware cannot deal with that.
The text was updated successfully, but these errors were encountered: