Skip to content

Commit

Permalink
[improve][broker] Add a message to a NullPointerException created in …
Browse files Browse the repository at this point in the history
…ManagedLedgerImpl (apache#17293)

- a NPE with no description is confusing
  • Loading branch information
lhotari authored Sep 28, 2022
1 parent 8aef1bf commit dfd4882
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3475,7 +3475,7 @@ public PositionImpl getNextValidPositionInternal(final PositionImpl position) {
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);
}
Expand Down

0 comments on commit dfd4882

Please sign in to comment.