Skip to content

Commit

Permalink
Remove exception mapping for java.security.AccessControlException (#…
Browse files Browse the repository at this point in the history
…6405)

`java.security.AccessControlException` has been deprecated for removal
for a while, and Nessie no longer throws this exception. Handling this
exception is no longer needed.
  • Loading branch information
snazy committed Mar 27, 2023
1 parent 1e31074 commit c4effde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.Provider;
import java.security.AccessControlException;
import java.util.stream.Collectors;
import org.projectnessie.error.BaseNessieClientServerException;
import org.projectnessie.error.ErrorCode;
Expand Down Expand Up @@ -76,8 +75,7 @@ public Response toResponse(Exception exception) {
LOGGER.warn("Backend throttled/refused the request: {}", exception.toString());
errorCode = ErrorCode.TOO_MANY_REQUESTS;
message = "Backend store refused to process the request: " + exception;
} else if (exception instanceof AccessControlException
|| exception instanceof AccessCheckException) {
} else if (exception instanceof AccessCheckException) {
errorCode = ErrorCode.FORBIDDEN;
message = exception.getMessage();
} else if (exception instanceof NotSupportedException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.google.common.base.Throwables;
import java.security.AccessControlException;
import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.ws.rs.NotSupportedException;
Expand Down Expand Up @@ -76,8 +75,7 @@ public Response toResponse(Exception exception) {
LOGGER.warn("Backend throttled/refused the request: {}", exception.toString());
errorCode = ErrorCode.TOO_MANY_REQUESTS;
message = "Backend store refused to process the request: " + exception;
} else if (exception instanceof AccessControlException
|| exception instanceof AccessCheckException) {
} else if (exception instanceof AccessCheckException) {
errorCode = ErrorCode.FORBIDDEN;
message = exception.getMessage();
} else if (exception instanceof NotSupportedException) {
Expand Down

0 comments on commit c4effde

Please sign in to comment.