From aa8a761fe294f9b8e1489c961c4718bf1c77d0b9 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Mon, 20 Aug 2012 12:30:38 +0900 Subject: [PATCH] Better exception message .. as advised by @jpinner --- buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java b/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java index 3ed578aab3..e7b856a8a7 100644 --- a/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java @@ -182,12 +182,13 @@ public abstract class AbstractByteBuf implements ByteBuf { if (minWritableBytes < 0) { throw new IllegalArgumentException(String.format( - "minWritableBytes: %d (expected: 0+)", minWritableBytes)); + "minWritableBytes: %d (expected: >= 0)", minWritableBytes)); } if (minWritableBytes > maxCapacity - writerIndex) { 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.