AMashenkov commented on code in PR #2964:
URL: https://github.com/apache/ignite-3/pull/2964#discussion_r1432794622


##########
modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java:
##########
@@ -105,7 +106,7 @@ public static ErrorGroup errorGroupByGroupCode(short 
groupCode) {
      * @param code Full error code
      * @return Error Group.
      */
-    public static ErrorGroup errorGroupByCode(int code) {
+    public static @Nullable ErrorGroup errorGroupByCode(int code) {

Review Comment:
   This change make no sense. It forces a caller to handle null value, but 
actually, no one  do it.
   
   I guess this may be useful, when got an exception from remote side of newer 
version and the error group just doesn't exists locally yet.
   ```suggestion
       public static ErrorGroup errorGroupByCode(int code) {
               assert registeredGroups.get(extractGroupCode(code)) != null;
   ```
   or better return a predefined group implementation for unknown errors
   ```suggestion
       public static ErrorGroup errorGroupByCode(int code) { 
               return registeredGroups.getOrDefault(extractGroupCode(code), 
UNKNOWN)
   ```



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