Created
December 18, 2018 23:47
-
-
Save rodurma/5ba67e9add34d0fdb18c6c97a5842510 to your computer and use it in GitHub Desktop.
Pegando o body de uma requisição que gerou uma Exception GuzzleHttp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
// do something... | |
} catch (\GuzzleHttp\Exception\ClientException $e) { | |
return $e->getResponse()->getBody()->getContents(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment