Skip to content

Commit

Permalink
fix(oxauth): propagate WebApplicationException out of create AT method
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Feb 21, 2023
1 parent df035e3 commit 71e195e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import javax.ws.rs.WebApplicationException;
import java.util.Date;
import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -195,6 +196,8 @@ public AccessToken createAccessToken(String certAsPem, ExecutionContext context)
log.trace("Created plain access token: {}", accessToken.getCode());

return accessToken;
} catch (WebApplicationException e) {
throw e;
} catch (Exception e) {
log.error(e.getMessage(), e);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ public void setWebApplicationException(WebApplicationException webApplicationExc
this.webApplicationException = webApplicationException;
}

public WebApplicationException createWebApplicationException(Response response) {
return new WebApplicationException(response);
}

public WebApplicationException createWebApplicationException(int status, String entity) {
this.webApplicationException = new WebApplicationException(Response
.status(status)
Expand Down

0 comments on commit 71e195e

Please sign in to comment.