Skip to content

Commit 385b6c7

Browse files
committed
Improve error message for InvalidBufferOffsetException
1 parent 06081a7 commit 385b6c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/truffleruby/core/exception/CoreExceptions.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,9 @@ public RubyException indexErrorInvalidArrayIndexException(InvalidArrayIndexExcep
443443
@TruffleBoundary
444444
public RubyException indexErrorInvalidBufferOffsetException(InvalidBufferOffsetException exception,
445445
Node currentNode) {
446-
return indexError("invalid buffer offset " + exception.getByteOffset(), currentNode);
446+
return indexError(
447+
"invalid buffer offset " + exception.getByteOffset() + " for buffer of length " + exception.getLength(),
448+
currentNode);
447449
}
448450

449451
// KeyError

0 commit comments

Comments
 (0)