ivanzlenko commented on code in PR #5574:
URL: https://github.com/apache/ignite-3/pull/5574#discussion_r2031436233


##########
modules/core/src/main/java/org/apache/ignite/internal/failure/FailureContext.java:
##########
@@ -30,15 +30,49 @@ public class FailureContext {
     /** Error. */
     private final Throwable err;
 
+    /** Message describing the failure. */
+    private final String message;
+
     /**
-     * Creates instance of {@link FailureContext}.
+     * Creates instance of {@link FailureContext} of {@link 
FailureType#CRITICAL_ERROR} type.
+     *
+     * @param err Exception.
+     */
+    public FailureContext(Throwable err) {
+        this(FailureType.CRITICAL_ERROR, err);
+    }
+
+    /**
+     * Creates instance of {@link FailureContext} corresponding to an unknown 
failure.
      *
      * @param type Failure type.
      * @param err Exception.
      */
     public FailureContext(FailureType type, Throwable err) {
+        this(type, err, "Unknown error");

Review Comment:
   Feels like it is better to have static factories here rather than a lot of 
constructors. 
   In that case it will be way easier to understand what is going on here. Even 
without javaDocs - just looking at code itself. 



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to