cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] rhtyd commented on a change in pull request #2387: CLOUDSTACK-8855 Improve Error Message for Host Alert State and reconnect host API.
Date Thu, 01 Jan 1970 00:00:00 GMT
rhtyd commented on a change in pull request #2387: CLOUDSTACK-8855 Improve Error Message for
Host Alert State and reconnect host API.
URL: https://github.com/apache/cloudstack/pull/2387#discussion_r159857677
 
 

 ##########
 File path: api/src/org/apache/cloudstack/api/command/admin/host/ReconnectHostCmd.java
 ##########
 @@ -101,16 +104,17 @@ public Long getInstanceId() {
     public void execute() {
         try {
             Host result = _resourceService.reconnectHost(this);
-            if (result != null) {
-                HostResponse response = _responseGenerator.createHostResponse(result);
-                response.setResponseName(getCommandName());
-                this.setResponseObject(response);
-            } else {
-                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reconnect
host");
-            }
-        } catch (Exception ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
+            HostResponse response = _responseGenerator.createHostResponse(result);
+            response.setResponseName(getCommandName());
+            this.setResponseObject(response);
+        }catch (InvalidParameterValueException e) {
+            throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.getMessage());
+        }
+        catch (CloudRuntimeException e) {
+            s_logger.warn("Exception: ", e);
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
+        }catch (AgentUnavailableException e) {
 
 Review comment:
   Same as above^^

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message