Skip to content

Commit 5e63480

Browse files
committed
Improve bounds error message for mapped files
1 parent c03b5e5 commit 5e63480

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/software/coley/lljzip/util/UnsafeMappedFile.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ private long validate(long position) {
150150
}
151151
position += address;
152152
if (position > end) {
153-
throw new IllegalArgumentException(Long.toString(position));
153+
long diff = position - end;
154+
throw new IllegalArgumentException("positon beyond max bounds: " + position + " > " + end + " diff: " + diff);
154155
}
155156
return position;
156157
}

0 commit comments

Comments
 (0)