[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-8855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16315184#comment-16315184
 ] 

ASF GitHub Bot commented on CLOUDSTACK-8855:
--------------------------------------------

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_r159857611
 
 

 ##########
 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) {
 
 Review comment:
   Fix this to be one same line as closing brace `}`

----------------------------------------------------------------
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:
us...@infra.apache.org


> Improve Error Message for Host Alert State
> ------------------------------------------
>
>                 Key: CLOUDSTACK-8855
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8855
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>    Affects Versions: 4.6.0
>            Reporter: Bharat Kumar
>            Assignee: Bharat Kumar
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to