private static function getErrorMessage($response)
    {
        $body = $response->getBody();

        $message = json_decode($body, true);
        $errors = [];

        if (is_array($message) && isset($message['errors'])) {
            $errors = $message['errors'];
        }

        if ($body == self::RATE_LIMIT_ERROR_MESSAGE) {
            $errors = [self::RATE_LIMIT_ERROR_MESSAGE];
        }

        return $errors;
    }
private static function getErrorMessage($response)
    {
        $body = $response->getBody();

        $message = json_decode($body, true);
        $errors = [];

        if (is_array($message) && isset($message['errors'])) {
            $errors = $message['errors'];
        }

        if ($body == self::RATE_LIMIT_ERROR_MESSAGE) {
            $errors = [self::RATE_LIMIT_ERROR_MESSAGE];
        }

        return $errors;
    }
private static function getErrorMessage ( $ response ) { $ body = $ response -> getBody ( ) ; $ message = json_decode ( $ body , true ) ; $ errors = [ ] ; if ( is_array ( $ message ) && isset ( $ message [ 'errors' ] ) ) { $ errors = $ message [ 'errors' ] ; } if ( $ body == self :: RATE_LIMIT_ERROR_MESSAGE ) { $ errors = [ self :: RATE_LIMIT_ERROR_MESSAGE ] ; } return $ errors ; }
Retrieve the error messages in the body

@param  \GuzzleHttp\Psr7\Response $response of the HTTP request
@return array Array of error messages
Retrieve the error messages in the body