public function tryCall($httpRequest)
{
try {
$response = \Scalr::getContainer()->http->sendRequest($httpRequest);
if (is_callable($this->callback)) {
call_user_func($this->callback, $httpRequest, $response);
}
} catch (\http\Exception $e) {
$response = 'Cannot establish connection to Azure server. ' . (isset($e->innerException) ? $e->innerException->getMessage() : $e->getMessage());
throw new RestClientException($response);
}
return $response;
}