Skip to content

Commit

Permalink
Ignore ContextNotActiveException in RESTEasy Reactive when clearing r…
Browse files Browse the repository at this point in the history
…equest

Fixes: #25229
  • Loading branch information
geoand committed May 2, 2022
1 parent 82e0259 commit b17cd68
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.resteasy.reactive.server.runtime;

import javax.enterprise.context.ContextNotActiveException;

import org.jboss.resteasy.reactive.server.core.CurrentRequest;
import org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext;

Expand All @@ -22,8 +24,12 @@ public ResteasyReactiveRequestContext get() {
@Override
public void set(ResteasyReactiveRequestContext set) {
if (set == null) {
currentVertxRequest.setOtherHttpContextObject(null);
currentVertxRequest.setCurrent(null);
try {
currentVertxRequest.setOtherHttpContextObject(null);
currentVertxRequest.setCurrent(null);
} catch (ContextNotActiveException ignored) {

}
} else {
currentVertxRequest.setOtherHttpContextObject(set);
currentVertxRequest.setCurrent(set.unwrap(RoutingContext.class));
Expand Down

0 comments on commit b17cd68

Please sign in to comment.