diff --git a/dd-java-agent/instrumentation/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextSessionAdvice.java b/dd-java-agent/instrumentation/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextSessionAdvice.java index 866e9c71ffa..4a7948188ea 100644 --- a/dd-java-agent/instrumentation/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextSessionAdvice.java +++ b/dd-java-agent/instrumentation/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextSessionAdvice.java @@ -17,11 +17,10 @@ @RequiresRequestContext(RequestContextSlot.APPSEC) class RoutingContextSessionAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodEnter(suppress = Throwable.class) static void after( @ActiveRequestContext final RequestContext reqCtx, - @Advice.Argument(0) final Session session, - @Advice.Thrown(readOnly = false) Throwable throwable) { + @Advice.Argument(0) final Session session) { if (session == null) { return; @@ -47,9 +46,7 @@ static void after( rba.getStatusCode(), rba.getBlockingContentType(), rba.getExtraHeaders()); - if (throwable == null) { - throwable = new BlockingException("Blocked request (for session)"); - } + throw new BlockingException("Blocked request (for session)"); } } } diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextSessionAdvice.java b/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextSessionAdvice.java index 2824822b3be..69ef46fbdf7 100644 --- a/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextSessionAdvice.java +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextSessionAdvice.java @@ -17,11 +17,10 @@ @RequiresRequestContext(RequestContextSlot.APPSEC) class RoutingContextSessionAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodEnter(suppress = Throwable.class) static void after( @ActiveRequestContext final RequestContext reqCtx, - @Advice.Argument(0) final Session session, - @Advice.Thrown(readOnly = false) Throwable throwable) { + @Advice.Argument(0) final Session session) { if (session == null) { return; @@ -47,9 +46,7 @@ static void after( rba.getStatusCode(), rba.getBlockingContentType(), rba.getExtraHeaders()); - if (throwable == null) { - throwable = new BlockingException("Blocked request (for session)"); - } + throw new BlockingException("Blocked request (for session)"); } } }