Mailgun\Connection\RestClient::getResponseExceptionMessage PHP Method

getResponseExceptionMessage() protected method

protected getResponseExceptionMessage ( Psr\Http\Message\ResponseInterface $responseObj ) : string
$responseObj Psr\Http\Message\ResponseInterface
return string
    protected function getResponseExceptionMessage(ResponseInterface $responseObj)
    {
        $body = (string) $responseObj->getBody();
        $response = json_decode($body);
        if (json_last_error() == JSON_ERROR_NONE && isset($response->message)) {
            return ' ' . $response->message;
        }
        return '';
    }