Skip to content

Commit 9d95e6e

Browse files
committed
fix
1 parent 610384e commit 9d95e6e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

instrumentation/ratpack/ratpack-1.4/testing/src/main/java/io/opentelemetry/instrumentation/ratpack/client/AbstractRatpackHttpClientTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,15 @@ private static Throwable nettyClientSpanErrorMapper(URI uri, Throwable exception
171171
if (uri.getPath().equals("/read-timeout")) {
172172
return ReadTimeoutException.INSTANCE;
173173
}
174-
// For connection errors, return the actual exception
174+
if ("https://192.0.2.1/".equals(uri.toString())) {
175+
// Ratpack wraps the lower-level Netty ConnectTimeoutException with its own message; unwrap
176+
// to compare against the span emitted by the Netty instrumentation.
177+
Throwable cause = exception.getCause();
178+
if (cause != null) {
179+
return cause;
180+
}
181+
}
182+
// For other connection errors, return the exception we observed
175183
return exception;
176184
}
177185

0 commit comments

Comments
 (0)