Skip to content

Commit 0be03bd

Browse files
committed
Better error message for toPrimitive type checks
1 parent 04551ff commit 0be03bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/at/favre/lib/bytes/Util.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ static void checkIndexBounds(int length, int index, int primitiveLength, String
431431

432432
static void checkExactLength(int length, int expectedLength, String type) {
433433
if (length != expectedLength) {
434-
throw new IllegalStateException("cannot convert to " + type + " if length != " + expectedLength + " bytes");
434+
throw new IllegalStateException("cannot convert to " + type + " if length != " + expectedLength + " bytes (was " + length + ")");
435435
}
436436
}
437437

0 commit comments

Comments
 (0)