HttpResponseDecorator affinityResponse = (HttpResponseDecorator) po.getAzureClient().createAffinityGroup(props);
String requestId = (String) po.getAzureClient().getRequestId(affinityResponse);
waitUntilComplete(po.getAzureClient(), requestId);
} else if (ex instanceof HttpResponseException) {
LOGGER.error(String.format("Error occurs on %s stack under the affinity group creation", stack.getId()), ex);
throw new InternalServerException(((HttpResponseException) ex).getResponse().toString());
} else {
LOGGER.error(String.format("Error occurs on %s stack under the affinity group creation", stack.getId()), ex);
throw new StackCreationFailureException(ex);
}
}