Skip to content

Commit

Permalink
Fix error message for exhausted range
Browse files Browse the repository at this point in the history
The exception message was reporting wrong numbers for requests because
there was a non correct hex conversion. Additionally, it was reporting the
wrong value because it was increasing even no new requests could be
generated.

Fix BZ#2332610
  • Loading branch information
fmarco76 committed Jan 28, 2025
1 parent 25cb21a commit a1c0d76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,17 @@ protected void checkRange() throws EBaseException
logger.debug("Reached the end of the range. Attempting to move to next range");
if (!hasNextRange()) {
if (rangeLength == null || mCounter.compareTo(rangeLength) >= 0) {
String latest = mRadix == HEX ? "0x" + mMaxSerialNo.toString(HEX) : mMaxSerialNo.toString();
throw new DBException(CMS.getUserMessage("CMS_DBS_LIMIT_REACHED",
mLastSerialNo.toString()));
latest));
}
return;
}
switchToNextRange();
} else {
String latest = mRadix == HEX ? "0x" + mMaxSerialNo.toString(HEX) : mMaxSerialNo.toString();
throw new DBException(CMS.getUserMessage("CMS_DBS_LIMIT_REACHED",
mLastSerialNo.toString()));
latest));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion base/server/src/main/resources/UserMessages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ CMS_DBS_LDAP_OP_FAILURE=LDAP operation failure - {0}
CMS_DBS_NO_MAPPER_FOUND=No mapper found for {0}
CMS_DBS_INTERNAL_DIR_ERROR=Internal Database Error encountered: {0}
CMS_DBS_ADD_ENTRY_FAILED=Failed to add the schema entry: {0}
CMS_DBS_LIMIT_REACHED=All serial numbers are used. The max serial number is 0x{0}
CMS_DBS_LIMIT_REACHED=All serial numbers are used. The max serial number is {0}
CMS_DBS_SETBACK_SERIAL=The serial number is already in use.\nYou can only set the serial number greater than 0x{0}
CMS_DBS_SETBACK_MAXSERIAL=The serial number is already in use.\nYou can only set the end serial number greater than 0x{0}
CMS_DBS_LDIF_FAILED=Failed to create ldif file: {0}
Expand Down

0 comments on commit a1c0d76

Please sign in to comment.