ptupitsyn commented on code in PR #7620:
URL: https://github.com/apache/ignite-3/pull/7620#discussion_r2822141209
##########
modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java:
##########
@@ -161,9 +166,13 @@ public static ErrorGroup errorGroupByGroupCode(short
groupCode) {
* @return Error Group.
*/
public static ErrorGroup errorGroupByCode(int code) {
- ErrorGroup grp = registeredGroups.get(extractGroupCode(code));
- assert grp != null : "group not found, code=" + code;
- return grp;
+ short groupCode = extractGroupCode(code);
+ ErrorGroup grp = registeredGroups.get(groupCode);
+
+ // Newer versions of Ignite may contain error codes that are not known
to the older versions.
+ return grp == null
+ ? new ErrorGroup(IGNITE_ERR_PREFIX, ERR_GROUP_PREFIX_UNKNOWN +
groupCode, groupCode)
Review Comment:
Because with normal exceptions we have the actual group name, such as
`IGN-TX-3`, but on an old client you'll see that as `IGN-UNKNOWN-3` - no way to
see the group code from the exception string.
With the code appended we see `IGN-UNKNOWN7-3`, which is more useful - you
can check the docs or the source code to find out the actual group name.
--
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]