[improve][broker] Add a message to a NullPointerException created in ManagedLedgerImpl
a NPE with no description is confusing
@@ -3475,7 +3475,7 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
while (!isValidPosition(nextPosition)) {
Long nextLedgerId = ledgers.ceilingKey(nextPosition.getLedgerId() + 1);
if (nextLedgerId == null) {
- throw new NullPointerException();
+ throw new NullPointerException("nextLedgerId is null. No valid next position after " + position);
}
nextPosition = PositionImpl.get(nextLedgerId, 0);
}
