Github user lahirus commented on a diff in the pull request:

    https://github.com/apache/stratos/pull/492#discussion_r45546039
  
    --- Diff: 
components/org.apache.stratos.mock.iaas.client/src/main/java/org/apache/stratos/mock/iaas/client/MockIaasApiClient.java
 ---
    @@ -48,6 +49,20 @@ public MockIaasApiClient(String endpoint) {
             this.endpoint = endpoint;
         }
     
    +    public boolean isMockIaaSReady() {
    +        try {
    +            URI uri = new URIBuilder(endpoint + INIT_CONTEXT).build();
    +            HttpResponse response = restClient.doGet(uri);
    +            if (response != null) {
    +                return response.getStatusCode() == 200;
    +            }
    +            throw new RuntimeException("An unknown error occurred");
    +        } catch (Exception e) {
    +            String message = "Could not check whether mock-iaas is active";
    +            throw new RuntimeException(message, e);
    --- End diff --
    
    Let's use custom exceptions instead of RuntimeException.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to