sk0x50 commented on code in PR #904:
URL: https://github.com/apache/ignite-3/pull/904#discussion_r911829419


##########
modules/core/src/main/java/org/apache/ignite/lang/IgniteInternalCheckedException.java:
##########
@@ -26,29 +34,182 @@ public class IgniteInternalCheckedException extends 
Exception {
     /** Serial version uid. */
     private static final long serialVersionUID = 0L;
 
+    /** Name of the error group. */
+    private final String groupName;
+
+    /**
+     * Error code which contains information about error group and code, where 
code is unique within the group.
+     * The structure of a code is shown in the following diagram:
+     * +------------+--------------+
+     * |  16 bits   |    16 bits   |
+     * +------------+--------------+
+     * | Group Code |  Error Code  |
+     * +------------+--------------+
+     */
+    private final int code;
+
+    /** Unique identifier of this exception that should help locating the 
error message in a log file. */
+    private final UUID traceId;
+
+    /**
+     * Creates a new exception with the given group and error code.
+     *
+     * @param groupName Group name.
+     * @param code Full error code.
+     */
+    public IgniteInternalCheckedException(String groupName, int code) {

Review Comment:
   Well, that was my first thought, however, it does not seem to be working in 
case of RU. Let's assume that node (that have a new error group) wants to send 
an error to the old node. Perhaps, we need something as follows:
   ```
   public class IgniteInternalCheckedException extends Exception {
       String groupName;
       int code;
       public IgniteInternalCheckedException(int fullErrorCode) {
           this.groupName = 
ErrorGroup.groupByCode(ErrorGroup.extractGroupCode(fullErrorCode));
           this.code = fullErrorCode;
       }
       ...
   }
   public class ModuleSpecificCheckedException extends 
IgniteInternalCheckedException {
       public ModuleSpecificCheckedException(int fullErrorCode) {
           super(fullErrorCode);
           
           // check that error code relates to the specific group
           assert ErrorGroups.ModuleGroup.CUSTOM_ERR_GRP.code() == 
ErrorGroup.extractGroupCode(fullErrorCode); 
       }
       ...
   }
   ```
   



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