I'm having weird issues while using Guzzle
When I try to simulate an erroneous request (e.g. a request which returns a status code 404) Guzzle throws a ClientException containing all the details of why that request failed.
When I try to catch this exception my script exits with a fatal error stating that I didn't catch the exception and it shows an XDebug trace stating that I had a memory leak somehow.
My code looks like this:
Note: httpClient is a valid instance of GuzzleHttp/CLient.
$request = $this->httpClient->createRequest(
'GET',
'/templates/'.$id
);
try {
$response = $this->httpClient->send($request);
} catch (\Exception $exception) {
die('exception occured');
}
The error I end up with is the following:
Guzzle stack trace
Memory leak
Does someone have a suggestion to what might cause this uncaught exception + leak?