xyuanlu commented on code in PR #2208:
URL: https://github.com/apache/helix/pull/2208#discussion_r971077654
##########
helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstancesAccessor.java:
##########
@@ -277,10 +277,7 @@ private Response batchGetStoppableInstances(String
clusterId, JsonNode node, boo
.error(String.format("Current cluster %s has issue with health
checks!", clusterId), e);
throw new HelixHealthException(e);
} catch (Exception e) {
- _logger.error(String.format(
- "Failed to get parallel stoppable instances for cluster %s with
a HelixException!",
- clusterId), e);
- throw e;
+ throw new Exception("Failed to get parallel stoppable instances for
cluster " + clusterId + " with a HelixException!", e);
Review Comment:
The caught exception is a base type, the actual object can be any derived
type (for example, HelixException). The object you throw is an object of the
base type.
If there is a try-catch block in caller that catch any derived type (for
example, HelixException), the base type exception won't be caught. -> we will
have behavior change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]