Skip to content

Commit 080cc97

Browse files
committed
Fix error message for exhausted range
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
1 parent ca443ec commit 080cc97

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

base/server/src/main/java/com/netscape/cmscore/dbs/Repository.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,17 @@ protected void checkRange() throws EBaseException
394394
logger.debug("Reached the end of the range. Attempting to move to next range");
395395
if (!hasNextRange()) {
396396
if (rangeLength == null || mCounter.compareTo(rangeLength) >= 0) {
397+
String latest = mRadix == HEX ? "0x" + mMaxSerialNo.toString(HEX) : mMaxSerialNo.toString();
397398
throw new DBException(CMS.getUserMessage("CMS_DBS_LIMIT_REACHED",
398-
mLastSerialNo.toString()));
399+
latest));
399400
}
400401
return;
401402
}
402403
switchToNextRange();
403404
} else {
405+
String latest = mRadix == HEX ? "0x" + mMaxSerialNo.toString(HEX) : mMaxSerialNo.toString();
404406
throw new DBException(CMS.getUserMessage("CMS_DBS_LIMIT_REACHED",
405-
mLastSerialNo.toString()));
407+
latest));
406408
}
407409
}
408410
}

base/server/src/main/resources/UserMessages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ CMS_DBS_LDAP_OP_FAILURE=LDAP operation failure - {0}
455455
CMS_DBS_NO_MAPPER_FOUND=No mapper found for {0}
456456
CMS_DBS_INTERNAL_DIR_ERROR=Internal Database Error encountered: {0}
457457
CMS_DBS_ADD_ENTRY_FAILED=Failed to add the schema entry: {0}
458-
CMS_DBS_LIMIT_REACHED=All serial numbers are used. The max serial number is 0x{0}
458+
CMS_DBS_LIMIT_REACHED=All serial numbers are used. The max serial number is {0}
459459
CMS_DBS_SETBACK_SERIAL=The serial number is already in use.\nYou can only set the serial number greater than 0x{0}
460460
CMS_DBS_SETBACK_MAXSERIAL=The serial number is already in use.\nYou can only set the end serial number greater than 0x{0}
461461
CMS_DBS_LDIF_FAILED=Failed to create ldif file: {0}

0 commit comments

Comments
 (0)