0
I would like to deal with Guzzle errors when the server returns 4xx and 5xx status codes. I make a request like this one:
$client = $this->getGuzzleClient();
$request = $client->post($url, $headers, $value);
try {
$response = $request->send();
return $response->getBody();
} catch (\Exception $e) {
//Com posso obter o conteudo do body da exception $e?
}
https://docs.guzzlephp.org/en/stable/quickstart.html#exceptions
– Marcos Xavier