Skip to content

Commit 53bb414

Browse files
committed
Output handle information to native handle error message.
1 parent a33c60b commit 53bb414

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/org/truffleruby/cext/CExtNodes.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,12 +1322,17 @@ public Object unwrap(Object value,
13221322
Object object = unwrapNode.execute(value);
13231323
if (object == null) {
13241324
exceptionProfile.enter();
1325-
throw new RaiseException(getContext(), coreExceptions().runtimeError("native handle not found", this));
1325+
throw new RaiseException(getContext(), coreExceptions().runtimeError(exceptionMessage(value), this));
13261326
} else {
13271327
return object;
13281328
}
13291329
}
13301330

1331+
@TruffleBoundary
1332+
private String exceptionMessage(Object value) {
1333+
return String.format("native handle not found (%s)", value);
1334+
}
1335+
13311336
protected UnwrapNode createUnwrapNode() {
13321337
return UnwrapNodeGen.create();
13331338
}

0 commit comments

Comments
 (0)