sanpwc commented on code in PR #722:
URL: https://github.com/apache/ignite-3/pull/722#discussion_r849813363


##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/ClusterInitializer.java:
##########
@@ -114,15 +121,17 @@ private CompletableFuture<Void> 
invokeMessage(Collection<ClusterNode> nodes, Net
                         .invoke(node, message, 10000)
                         .thenAccept(response -> {
                             if (response instanceof InitErrorMessage) {
-                                throw new InitException(String.format(
-                                        "Got error response from node \"%s\": 
%s", node.name(), ((InitErrorMessage) response).cause()
-                                ));
-                            }
-
-                            if (!(response instanceof InitCompleteMessage)) {
-                                throw new InitException(String.format(
-                                        "Unexpected response from node \"%s\": 
%s", node.name(), response.getClass()
-                                ));
+                                var errorResponse = (InitErrorMessage) 
response;
+
+                                throw new InternalInitException(
+                                        String.format("Got error response from 
node \"%s\": %s", node.name(), errorResponse.cause()),
+                                        errorResponse.shouldCancel()
+                                );
+                            } else if (!(response instanceof 
InitCompleteMessage)) {

Review Comment:
   Well, there's a typo in my question:
   What behavior do you expected if it's neither **InitErrorMessage** nor 
!(response instanceof InitCompleteMessage)?



-- 
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]

Reply via email to