Better exception message
.. as advised by @jpinner
This commit is contained in:
parent
10f26f3205
commit
aa8a761fe2
@ -182,12 +182,13 @@ public abstract class AbstractByteBuf implements ByteBuf {
|
|||||||
|
|
||||||
if (minWritableBytes < 0) {
|
if (minWritableBytes < 0) {
|
||||||
throw new IllegalArgumentException(String.format(
|
throw new IllegalArgumentException(String.format(
|
||||||
"minWritableBytes: %d (expected: 0+)", minWritableBytes));
|
"minWritableBytes: %d (expected: >= 0)", minWritableBytes));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minWritableBytes > maxCapacity - writerIndex) {
|
if (minWritableBytes > maxCapacity - writerIndex) {
|
||||||
throw new IllegalArgumentException(String.format(
|
throw new IllegalArgumentException(String.format(
|
||||||
"minWritableBytes: %d (exceeds maxCapacity(%d))", minWritableBytes, maxCapacity));
|
"writerIndex(%d) + minWritableBytes(%d) exceeds maxCapacity(%d)",
|
||||||
|
writerIndex, minWritableBytes, maxCapacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normalize the current capacity to the power of 2.
|
// Normalize the current capacity to the power of 2.
|
||||||
|
Loading…
Reference in New Issue
Block a user